From 98d3855faf38a02e1e589b293ba5293bef1decf4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 25 Jun 2026 08:07:00 +0000 Subject: [PATCH] Update SDK to version v3.96.3 - Generated from OpenAPI spec version v3.96.3 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 52 +- build.gradle | 4 +- build.sbt | 2 +- docs/AddIssuerDomainInputBody.md | 13 + docs/AddOwnerInputBody.md | 13 + docs/AddTeamMemberInputBody.md | 13 + docs/BulkCreateUserResult.md | 18 + docs/BulkCreateUsersOutputBody.md | 16 + docs/CreateGroupInputBody.md | 13 + docs/CreateIdentityInputBody.md | 15 + docs/CreateIssuerInputBody.md | 14 + docs/CreateOrganisationInputBody.md | 13 + docs/CreateTeamInputBody.md | 13 + docs/CreateUserInputBody.md | 45 ++ docs/FormFile.md | 16 + docs/IamUsersApi.md | 143 ++++ docs/InviteUserInputBody.md | 18 + docs/IssuerAllowedDomain.md | 18 + docs/ListTeamsOutputBody.md | 14 + docs/ListUsersOutputBody.md | 14 + docs/LocationOutputBody.md | 28 + docs/MessageBody.md | 13 + docs/OIDCCallbackInputBody.md | 16 + docs/Organisation.md | 16 + docs/OrganisationGroup.md | 18 + docs/OrganisationIssuer.md | 20 + docs/OrganisationOwner.md | 16 + docs/PasswordResetInputBody.md | 13 + docs/Permissions.md | 17 + docs/RefreshBody.md | 13 + docs/RegisterUserInputBody.md | 18 + docs/RevokeBody.md | 13 + docs/SSOProvider.md | 14 + docs/SSOProvidersOutputBody.md | 13 + docs/Team.md | 28 + docs/TeamMember.md | 29 + docs/TokenInputBody.md | 16 + docs/TokenResponse.md | 16 + docs/UpdateIssuerInputBody.md | 13 + docs/UpdateOrganisationInputBody.md | 13 + docs/UpdatePasswordInputBody.md | 14 + docs/UpdateProfileInputBody.md | 17 + docs/UpdateTeamInputBody.md | 13 + docs/UpdateUserCreditsInputBody.md | 13 + docs/UpdateUserInputBody.md | 43 ++ docs/UpdateUserPasswordInputBody.md | 14 + docs/User.md | 43 ++ docs/UserCredits.md | 16 + docs/UserIdentity.md | 18 + docs/UserProfile.md | 17 + pom.xml | 2 +- src/main/java/ai/reveng/api/IamUsersApi.java | 322 +++++++++ .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 46 ++ .../model/AddIssuerDomainInputBody.java | 289 ++++++++ .../ai/reveng/model/AddOwnerInputBody.java | 287 ++++++++ .../reveng/model/AddTeamMemberInputBody.java | 287 ++++++++ .../ai/reveng/model/BulkCreateUserResult.java | 430 ++++++++++++ .../model/BulkCreateUsersOutputBody.java | 385 +++++++++++ .../ai/reveng/model/CreateGroupInputBody.java | 289 ++++++++ .../reveng/model/CreateIdentityInputBody.java | 345 ++++++++++ .../reveng/model/CreateIssuerInputBody.java | 318 +++++++++ .../model/CreateOrganisationInputBody.java | 289 ++++++++ .../ai/reveng/model/CreateTeamInputBody.java | 289 ++++++++ .../ai/reveng/model/CreateUserInputBody.java | 643 ++++++++++++++++++ src/main/java/ai/reveng/model/FormFile.java | 370 ++++++++++ .../ai/reveng/model/InviteUserInputBody.java | 430 ++++++++++++ .../ai/reveng/model/IssuerAllowedDomain.java | 426 ++++++++++++ .../ai/reveng/model/ListTeamsOutputBody.java | 333 +++++++++ .../ai/reveng/model/ListUsersOutputBody.java | 333 +++++++++ .../ai/reveng/model/LocationOutputBody.java | 409 +++++++++++ .../java/ai/reveng/model/MessageBody.java | 289 ++++++++ .../reveng/model/OIDCCallbackInputBody.java | 376 ++++++++++ .../java/ai/reveng/model/Organisation.java | 368 ++++++++++ .../ai/reveng/model/OrganisationGroup.java | 420 ++++++++++++ .../ai/reveng/model/OrganisationIssuer.java | 478 +++++++++++++ .../ai/reveng/model/OrganisationOwner.java | 365 ++++++++++ .../reveng/model/PasswordResetInputBody.java | 289 ++++++++ .../java/ai/reveng/model/Permissions.java | 309 +++++++++ .../java/ai/reveng/model/RefreshBody.java | 282 ++++++++ .../reveng/model/RegisterUserInputBody.java | 434 ++++++++++++ src/main/java/ai/reveng/model/RevokeBody.java | 282 ++++++++ .../java/ai/reveng/model/SSOProvider.java | 318 +++++++++ .../reveng/model/SSOProvidersOutputBody.java | 307 +++++++++ src/main/java/ai/reveng/model/Team.java | 349 ++++++++++ src/main/java/ai/reveng/model/TeamMember.java | 459 +++++++++++++ .../java/ai/reveng/model/TokenInputBody.java | 369 ++++++++++ .../java/ai/reveng/model/TokenResponse.java | 373 ++++++++++ .../reveng/model/UpdateIssuerInputBody.java | 286 ++++++++ .../model/UpdateOrganisationInputBody.java | 289 ++++++++ .../reveng/model/UpdatePasswordInputBody.java | 318 +++++++++ .../reveng/model/UpdateProfileInputBody.java | 396 +++++++++++ .../ai/reveng/model/UpdateTeamInputBody.java | 282 ++++++++ .../model/UpdateUserCreditsInputBody.java | 287 ++++++++ .../ai/reveng/model/UpdateUserInputBody.java | 580 ++++++++++++++++ .../model/UpdateUserPasswordInputBody.java | 318 +++++++++ src/main/java/ai/reveng/model/User.java | 472 +++++++++++++ .../java/ai/reveng/model/UserCredits.java | 365 ++++++++++ .../java/ai/reveng/model/UserIdentity.java | 423 ++++++++++++ .../java/ai/reveng/model/UserProfile.java | 321 +++++++++ 102 files changed, 17941 insertions(+), 9 deletions(-) create mode 100644 docs/AddIssuerDomainInputBody.md create mode 100644 docs/AddOwnerInputBody.md create mode 100644 docs/AddTeamMemberInputBody.md create mode 100644 docs/BulkCreateUserResult.md create mode 100644 docs/BulkCreateUsersOutputBody.md create mode 100644 docs/CreateGroupInputBody.md create mode 100644 docs/CreateIdentityInputBody.md create mode 100644 docs/CreateIssuerInputBody.md create mode 100644 docs/CreateOrganisationInputBody.md create mode 100644 docs/CreateTeamInputBody.md create mode 100644 docs/CreateUserInputBody.md create mode 100644 docs/FormFile.md create mode 100644 docs/IamUsersApi.md create mode 100644 docs/InviteUserInputBody.md create mode 100644 docs/IssuerAllowedDomain.md create mode 100644 docs/ListTeamsOutputBody.md create mode 100644 docs/ListUsersOutputBody.md create mode 100644 docs/LocationOutputBody.md create mode 100644 docs/MessageBody.md create mode 100644 docs/OIDCCallbackInputBody.md create mode 100644 docs/Organisation.md create mode 100644 docs/OrganisationGroup.md create mode 100644 docs/OrganisationIssuer.md create mode 100644 docs/OrganisationOwner.md create mode 100644 docs/PasswordResetInputBody.md create mode 100644 docs/Permissions.md create mode 100644 docs/RefreshBody.md create mode 100644 docs/RegisterUserInputBody.md create mode 100644 docs/RevokeBody.md create mode 100644 docs/SSOProvider.md create mode 100644 docs/SSOProvidersOutputBody.md create mode 100644 docs/Team.md create mode 100644 docs/TeamMember.md create mode 100644 docs/TokenInputBody.md create mode 100644 docs/TokenResponse.md create mode 100644 docs/UpdateIssuerInputBody.md create mode 100644 docs/UpdateOrganisationInputBody.md create mode 100644 docs/UpdatePasswordInputBody.md create mode 100644 docs/UpdateProfileInputBody.md create mode 100644 docs/UpdateTeamInputBody.md create mode 100644 docs/UpdateUserCreditsInputBody.md create mode 100644 docs/UpdateUserInputBody.md create mode 100644 docs/UpdateUserPasswordInputBody.md create mode 100644 docs/User.md create mode 100644 docs/UserCredits.md create mode 100644 docs/UserIdentity.md create mode 100644 docs/UserProfile.md create mode 100644 src/main/java/ai/reveng/api/IamUsersApi.java create mode 100644 src/main/java/ai/reveng/model/AddIssuerDomainInputBody.java create mode 100644 src/main/java/ai/reveng/model/AddOwnerInputBody.java create mode 100644 src/main/java/ai/reveng/model/AddTeamMemberInputBody.java create mode 100644 src/main/java/ai/reveng/model/BulkCreateUserResult.java create mode 100644 src/main/java/ai/reveng/model/BulkCreateUsersOutputBody.java create mode 100644 src/main/java/ai/reveng/model/CreateGroupInputBody.java create mode 100644 src/main/java/ai/reveng/model/CreateIdentityInputBody.java create mode 100644 src/main/java/ai/reveng/model/CreateIssuerInputBody.java create mode 100644 src/main/java/ai/reveng/model/CreateOrganisationInputBody.java create mode 100644 src/main/java/ai/reveng/model/CreateTeamInputBody.java create mode 100644 src/main/java/ai/reveng/model/CreateUserInputBody.java create mode 100644 src/main/java/ai/reveng/model/FormFile.java create mode 100644 src/main/java/ai/reveng/model/InviteUserInputBody.java create mode 100644 src/main/java/ai/reveng/model/IssuerAllowedDomain.java create mode 100644 src/main/java/ai/reveng/model/ListTeamsOutputBody.java create mode 100644 src/main/java/ai/reveng/model/ListUsersOutputBody.java create mode 100644 src/main/java/ai/reveng/model/LocationOutputBody.java create mode 100644 src/main/java/ai/reveng/model/MessageBody.java create mode 100644 src/main/java/ai/reveng/model/OIDCCallbackInputBody.java create mode 100644 src/main/java/ai/reveng/model/Organisation.java create mode 100644 src/main/java/ai/reveng/model/OrganisationGroup.java create mode 100644 src/main/java/ai/reveng/model/OrganisationIssuer.java create mode 100644 src/main/java/ai/reveng/model/OrganisationOwner.java create mode 100644 src/main/java/ai/reveng/model/PasswordResetInputBody.java create mode 100644 src/main/java/ai/reveng/model/Permissions.java create mode 100644 src/main/java/ai/reveng/model/RefreshBody.java create mode 100644 src/main/java/ai/reveng/model/RegisterUserInputBody.java create mode 100644 src/main/java/ai/reveng/model/RevokeBody.java create mode 100644 src/main/java/ai/reveng/model/SSOProvider.java create mode 100644 src/main/java/ai/reveng/model/SSOProvidersOutputBody.java create mode 100644 src/main/java/ai/reveng/model/Team.java create mode 100644 src/main/java/ai/reveng/model/TeamMember.java create mode 100644 src/main/java/ai/reveng/model/TokenInputBody.java create mode 100644 src/main/java/ai/reveng/model/TokenResponse.java create mode 100644 src/main/java/ai/reveng/model/UpdateIssuerInputBody.java create mode 100644 src/main/java/ai/reveng/model/UpdateOrganisationInputBody.java create mode 100644 src/main/java/ai/reveng/model/UpdatePasswordInputBody.java create mode 100644 src/main/java/ai/reveng/model/UpdateProfileInputBody.java create mode 100644 src/main/java/ai/reveng/model/UpdateTeamInputBody.java create mode 100644 src/main/java/ai/reveng/model/UpdateUserCreditsInputBody.java create mode 100644 src/main/java/ai/reveng/model/UpdateUserInputBody.java create mode 100644 src/main/java/ai/reveng/model/UpdateUserPasswordInputBody.java create mode 100644 src/main/java/ai/reveng/model/User.java create mode 100644 src/main/java/ai/reveng/model/UserCredits.java create mode 100644 src/main/java/ai/reveng/model/UserIdentity.java create mode 100644 src/main/java/ai/reveng/model/UserProfile.java diff --git a/.sdk-version b/.sdk-version index 723fa07..637d249 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.96.2 +v3.96.3 diff --git a/README.md b/README.md index 51620ae..170e860 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.96.2 + 3.96.3 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.96.2" + implementation "ai.reveng:sdk:3.96.3" } ``` @@ -222,6 +222,8 @@ Class | Method | HTTP request | Description *FunctionsRenamingHistoryApi* | [**renameFunctionId**](docs/FunctionsRenamingHistoryApi.md#renameFunctionId) | **POST** /v2/functions/rename/{function_id} | Rename Function *FunctionsRenamingHistoryApi* | [**revertFunctionName**](docs/FunctionsRenamingHistoryApi.md#revertFunctionName) | **POST** /v2/functions/history/{function_id}/{history_id} | Revert the function name *FunctionsRenamingHistoryApi* | [**revertFunctionName_0**](docs/FunctionsRenamingHistoryApi.md#revertFunctionName_0) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name +*IamUsersApi* | [**getMe**](docs/IamUsersApi.md#getMe) | **GET** /v2/iam/me | Get current user +*IamUsersApi* | [**getMyPermissions**](docs/IamUsersApi.md#getMyPermissions) | **GET** /v2/iam/me/permissions | Get current user permissions *ModelsApi* | [**getModels**](docs/ModelsApi.md#getModels) | **GET** /v2/models | Gets models *ReportsApi* | [**createPdfReport**](docs/ReportsApi.md#createPdfReport) | **POST** /v3/analyses/{analysis_id}/pdf | Start PDF report generation *ReportsApi* | [**downloadPdfReport**](docs/ReportsApi.md#downloadPdfReport) | **GET** /v3/analyses/{analysis_id}/pdf | Download generated PDF report @@ -239,6 +241,9 @@ Class | Method | HTTP request | Description - [AIDecompInverseStringMapItem](docs/AIDecompInverseStringMapItem.md) - [APIError](docs/APIError.md) - [AddCalleeInputBody](docs/AddCalleeInputBody.md) + - [AddIssuerDomainInputBody](docs/AddIssuerDomainInputBody.md) + - [AddOwnerInputBody](docs/AddOwnerInputBody.md) + - [AddTeamMemberInputBody](docs/AddTeamMemberInputBody.md) - [AddUserStringInputBody](docs/AddUserStringInputBody.md) - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) @@ -372,6 +377,8 @@ Class | Method | HTTP request | Description - [BinarySearchResponse](docs/BinarySearchResponse.md) - [BinarySearchResult](docs/BinarySearchResult.md) - [BinaryTaskStatus](docs/BinaryTaskStatus.md) + - [BulkCreateUserResult](docs/BulkCreateUserResult.md) + - [BulkCreateUsersOutputBody](docs/BulkCreateUsersOutputBody.md) - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) - [CallEdge](docs/CallEdge.md) - [CallEdgesOutputBody](docs/CallEdgesOutputBody.md) @@ -415,7 +422,13 @@ Class | Method | HTTP request | Description - [CreateCollectionInputBody](docs/CreateCollectionInputBody.md) - [CreateCollectionOutputBody](docs/CreateCollectionOutputBody.md) - [CreateConversationRequest](docs/CreateConversationRequest.md) + - [CreateGroupInputBody](docs/CreateGroupInputBody.md) + - [CreateIdentityInputBody](docs/CreateIdentityInputBody.md) + - [CreateIssuerInputBody](docs/CreateIssuerInputBody.md) + - [CreateOrganisationInputBody](docs/CreateOrganisationInputBody.md) - [CreatePortalSessionInputBody](docs/CreatePortalSessionInputBody.md) + - [CreateTeamInputBody](docs/CreateTeamInputBody.md) + - [CreateUserInputBody](docs/CreateUserInputBody.md) - [Created](docs/Created.md) - [DataTypesEntry](docs/DataTypesEntry.md) - [DecompFailedEvent](docs/DecompFailedEvent.md) @@ -474,6 +487,7 @@ Class | Method | HTTP request | Description - [FileHashes](docs/FileHashes.md) - [FileMetadata](docs/FileMetadata.md) - [Filters](docs/Filters.md) + - [FormFile](docs/FormFile.md) - [FuncDepsInner](docs/FuncDepsInner.md) - [FunctionArgument](docs/FunctionArgument.md) - [FunctionBlockDestinationResponse](docs/FunctionBlockDestinationResponse.md) @@ -534,6 +548,8 @@ Class | Method | HTTP request | Description - [ImportModel](docs/ImportModel.md) - [InlineComment](docs/InlineComment.md) - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) + - [InviteUserInputBody](docs/InviteUserInputBody.md) + - [IssuerAllowedDomain](docs/IssuerAllowedDomain.md) - [ListAnalysisFunctionsDataTypesOutputBody](docs/ListAnalysisFunctionsDataTypesOutputBody.md) - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) @@ -541,12 +557,16 @@ Class | Method | HTTP request | Description - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) - [ListFunctionsDataTypesOutputBody](docs/ListFunctionsDataTypesOutputBody.md) + - [ListTeamsOutputBody](docs/ListTeamsOutputBody.md) + - [ListUsersOutputBody](docs/ListUsersOutputBody.md) + - [LocationOutputBody](docs/LocationOutputBody.md) - [Logs](docs/Logs.md) - [MITRETechnique](docs/MITRETechnique.md) - [MatchFilters](docs/MatchFilters.md) - [MatchedFunction](docs/MatchedFunction.md) - [MatchedFunctionSuggestion](docs/MatchedFunctionSuggestion.md) - [MemdumpEntry](docs/MemdumpEntry.md) + - [MessageBody](docs/MessageBody.md) - [MetaModel](docs/MetaModel.md) - [ModelName](docs/ModelName.md) - [ModelsResponse](docs/ModelsResponse.md) @@ -555,11 +575,17 @@ Class | Method | HTTP request | Description - [NameConfidence](docs/NameConfidence.md) - [NameSourceType](docs/NameSourceType.md) - [NetworkActivity](docs/NetworkActivity.md) + - [OIDCCallbackInputBody](docs/OIDCCallbackInputBody.md) - [Order](docs/Order.md) + - [Organisation](docs/Organisation.md) + - [OrganisationGroup](docs/OrganisationGroup.md) + - [OrganisationIssuer](docs/OrganisationIssuer.md) + - [OrganisationOwner](docs/OrganisationOwner.md) - [PDBDebugModel](docs/PDBDebugModel.md) - [PEModel](docs/PEModel.md) - [PaginationModel](docs/PaginationModel.md) - [Params](docs/Params.md) + - [PasswordResetInputBody](docs/PasswordResetInputBody.md) - [PatchCollectionBinariesInputBody](docs/PatchCollectionBinariesInputBody.md) - [PatchCollectionBinariesOutputBody](docs/PatchCollectionBinariesOutputBody.md) - [PatchCollectionInputBody](docs/PatchCollectionInputBody.md) @@ -568,6 +594,7 @@ Class | Method | HTTP request | Description - [PatchCollectionTagsOutputBody](docs/PatchCollectionTagsOutputBody.md) - [PatchCommentBody](docs/PatchCommentBody.md) - [PcapBodyInfo](docs/PcapBodyInfo.md) + - [Permissions](docs/Permissions.md) - [Platform](docs/Platform.md) - [PriceOutput](docs/PriceOutput.md) - [PriceSummary](docs/PriceSummary.md) @@ -583,7 +610,9 @@ Class | Method | HTTP request | Description - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) - [ReAnalysisForm](docs/ReAnalysisForm.md) - [Recent](docs/Recent.md) + - [RefreshBody](docs/RefreshBody.md) - [RegenerateOutputBody](docs/RegenerateOutputBody.md) + - [RegisterUserInputBody](docs/RegisterUserInputBody.md) - [RegistryOperation](docs/RegistryOperation.md) - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) - [RenameAppliedEvent](docs/RenameAppliedEvent.md) @@ -594,8 +623,11 @@ Class | Method | HTTP request | Description - [ReportEvent](docs/ReportEvent.md) - [ReportInfo](docs/ReportInfo.md) - [ReportOptions](docs/ReportOptions.md) + - [RevokeBody](docs/RevokeBody.md) - [SBOM](docs/SBOM.md) - [SBOMPackage](docs/SBOMPackage.md) + - [SSOProvider](docs/SSOProvider.md) + - [SSOProvidersOutputBody](docs/SSOProvidersOutputBody.md) - [SandboxOptions](docs/SandboxOptions.md) - [SandboxStartMethod](docs/SandboxStartMethod.md) - [SandboxTimeout](docs/SandboxTimeout.md) @@ -656,7 +688,11 @@ Class | Method | HTTP request | Description - [TaskStatus](docs/TaskStatus.md) - [TaskStatusResponse](docs/TaskStatusResponse.md) - [TcpCarvedFile](docs/TcpCarvedFile.md) + - [Team](docs/Team.md) + - [TeamMember](docs/TeamMember.md) - [TimestampModel](docs/TimestampModel.md) + - [TokenInputBody](docs/TokenInputBody.md) + - [TokenResponse](docs/TokenResponse.md) - [TokenisedData](docs/TokenisedData.md) - [TriageFunctionResponse](docs/TriageFunctionResponse.md) - [TriageReportResponse](docs/TriageReportResponse.md) @@ -665,12 +701,24 @@ Class | Method | HTTP request | Description - [TypeDefinition](docs/TypeDefinition.md) - [UpdateDataTypesInputBody](docs/UpdateDataTypesInputBody.md) - [UpdateDataTypesOutputBody](docs/UpdateDataTypesOutputBody.md) + - [UpdateIssuerInputBody](docs/UpdateIssuerInputBody.md) + - [UpdateOrganisationInputBody](docs/UpdateOrganisationInputBody.md) + - [UpdatePasswordInputBody](docs/UpdatePasswordInputBody.md) + - [UpdateProfileInputBody](docs/UpdateProfileInputBody.md) + - [UpdateTeamInputBody](docs/UpdateTeamInputBody.md) + - [UpdateUserCreditsInputBody](docs/UpdateUserCreditsInputBody.md) + - [UpdateUserInputBody](docs/UpdateUserInputBody.md) + - [UpdateUserPasswordInputBody](docs/UpdateUserPasswordInputBody.md) - [UploadFileType](docs/UploadFileType.md) - [UploadResponse](docs/UploadResponse.md) - [UpsertAiDecomplationRatingRequest](docs/UpsertAiDecomplationRatingRequest.md) - [UpsertOverridesData](docs/UpsertOverridesData.md) - [UpsertOverridesInputBody](docs/UpsertOverridesInputBody.md) + - [User](docs/User.md) - [UserActivityResponse](docs/UserActivityResponse.md) + - [UserCredits](docs/UserCredits.md) + - [UserIdentity](docs/UserIdentity.md) + - [UserProfile](docs/UserProfile.md) - [Vulnerabilities](docs/Vulnerabilities.md) - [Vulnerability](docs/Vulnerability.md) - [WarningEvent](docs/WarningEvent.md) diff --git a/build.gradle b/build.gradle index 3d77d8d..fad16c6 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.96.2' +version = '3.96.3' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.96.2") + coordinates("ai.reveng", "sdk", "3.96.3") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 5231f16..6635987 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "3.96.2", + version := "3.96.3", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AddIssuerDomainInputBody.md b/docs/AddIssuerDomainInputBody.md new file mode 100644 index 0000000..86fad0d --- /dev/null +++ b/docs/AddIssuerDomainInputBody.md @@ -0,0 +1,13 @@ + + +# AddIssuerDomainInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**domain** | **String** | Email domain to allow (e.g. acme.com) | | + + + diff --git a/docs/AddOwnerInputBody.md b/docs/AddOwnerInputBody.md new file mode 100644 index 0000000..eda7224 --- /dev/null +++ b/docs/AddOwnerInputBody.md @@ -0,0 +1,13 @@ + + +# AddOwnerInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **Long** | User ID to add as owner | | + + + diff --git a/docs/AddTeamMemberInputBody.md b/docs/AddTeamMemberInputBody.md new file mode 100644 index 0000000..833329e --- /dev/null +++ b/docs/AddTeamMemberInputBody.md @@ -0,0 +1,13 @@ + + +# AddTeamMemberInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **Long** | User ID to add | | + + + diff --git a/docs/BulkCreateUserResult.md b/docs/BulkCreateUserResult.md new file mode 100644 index 0000000..33201dc --- /dev/null +++ b/docs/BulkCreateUserResult.md @@ -0,0 +1,18 @@ + + +# BulkCreateUserResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | Search is applied to string value | | +|**error** | **String** | Error description; present on failure | [optional] | +|**index** | **Long** | 1-based row index in the CSV | | +|**success** | **Boolean** | | | +|**user** | [**User**](User.md) | Created user; present on success | [optional] | +|**username** | **String** | Search is applied to string value | | + + + diff --git a/docs/BulkCreateUsersOutputBody.md b/docs/BulkCreateUsersOutputBody.md new file mode 100644 index 0000000..a8e6c6e --- /dev/null +++ b/docs/BulkCreateUsersOutputBody.md @@ -0,0 +1,16 @@ + + +# BulkCreateUsersOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**failed** | **Long** | | | +|**results** | [**List<BulkCreateUserResult>**](BulkCreateUserResult.md) | | | +|**succeeded** | **Long** | | | +|**total** | **Long** | | | + + + diff --git a/docs/CreateGroupInputBody.md b/docs/CreateGroupInputBody.md new file mode 100644 index 0000000..8c86b51 --- /dev/null +++ b/docs/CreateGroupInputBody.md @@ -0,0 +1,13 @@ + + +# CreateGroupInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Group name | | + + + diff --git a/docs/CreateIdentityInputBody.md b/docs/CreateIdentityInputBody.md new file mode 100644 index 0000000..e637339 --- /dev/null +++ b/docs/CreateIdentityInputBody.md @@ -0,0 +1,15 @@ + + +# CreateIdentityInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**issuerUrl** | **String** | Issuer URL (must be trusted by this organisation) | | +|**subject** | **String** | External subject identifier from the issuer | | +|**userId** | **Long** | Internal user ID to link | | + + + diff --git a/docs/CreateIssuerInputBody.md b/docs/CreateIssuerInputBody.md new file mode 100644 index 0000000..4270b53 --- /dev/null +++ b/docs/CreateIssuerInputBody.md @@ -0,0 +1,14 @@ + + +# CreateIssuerInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**clientId** | **String** | OIDC client ID for audience validation (recommended) | [optional] | +|**issuerUrl** | **String** | OIDC issuer URL to trust | | + + + diff --git a/docs/CreateOrganisationInputBody.md b/docs/CreateOrganisationInputBody.md new file mode 100644 index 0000000..2e8659c --- /dev/null +++ b/docs/CreateOrganisationInputBody.md @@ -0,0 +1,13 @@ + + +# CreateOrganisationInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Organisation name | | + + + diff --git a/docs/CreateTeamInputBody.md b/docs/CreateTeamInputBody.md new file mode 100644 index 0000000..e324853 --- /dev/null +++ b/docs/CreateTeamInputBody.md @@ -0,0 +1,13 @@ + + +# CreateTeamInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Team name | | + + + diff --git a/docs/CreateUserInputBody.md b/docs/CreateUserInputBody.md new file mode 100644 index 0000000..1ca3176 --- /dev/null +++ b/docs/CreateUserInputBody.md @@ -0,0 +1,45 @@ + + +# CreateUserInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**credits** | **Long** | Initial credit balance in credits (1 credit = 1000 units); defaults to 10 credits | [optional] | +|**email** | **String** | Email address | | +|**firstName** | **String** | First name | [optional] | +|**lastName** | **String** | Last name | [optional] | +|**password** | **String** | Initial password | | +|**role** | [**RoleEnum**](#RoleEnum) | User role (defaults to USER) | [optional] | +|**tier** | [**TierEnum**](#TierEnum) | User tier (defaults to ENTHUSIAST) | [optional] | +|**timeZone** | **String** | IANA time zone | [optional] | +|**username** | **String** | Username | | + + + +## Enum: RoleEnum + +| Name | Value | +|---- | -----| +| USER | "USER" | +| ADMIN | "ADMIN" | +| SUPERADMIN | "SUPERADMIN" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: TierEnum + +| Name | Value | +|---- | -----| +| ENTHUSIAST | "ENTHUSIAST" | +| REVERSER | "REVERSER" | +| BUG_HUNTER | "BUG_HUNTER" | +| MALWARE_ANALYST | "MALWARE_ANALYST" | +| SECURITY_RESEARCHER | "SECURITY_RESEARCHER" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/FormFile.md b/docs/FormFile.md new file mode 100644 index 0000000..5dad580 --- /dev/null +++ b/docs/FormFile.md @@ -0,0 +1,16 @@ + + +# FormFile + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**contentType** | **String** | Search is applied to string value | | +|**filename** | **String** | Search is applied to string value | | +|**isSet** | **Boolean** | | | +|**size** | **Long** | | | + + + diff --git a/docs/IamUsersApi.md b/docs/IamUsersApi.md new file mode 100644 index 0000000..4d851bf --- /dev/null +++ b/docs/IamUsersApi.md @@ -0,0 +1,143 @@ +# IamUsersApi + +All URIs are relative to *https://api.reveng.ai* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getMe**](IamUsersApi.md#getMe) | **GET** /v2/iam/me | Get current user | +| [**getMyPermissions**](IamUsersApi.md#getMyPermissions) | **GET** /v2/iam/me/permissions | Get current user permissions | + + + +# **getMe** +> User getMe() + +Get current user + +Returns the authenticated user's own information. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.IamUsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + IamUsersApi apiInstance = new IamUsersApi(defaultClient); + try { + User result = apiInstance.getMe(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IamUsersApi#getMe"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**User**](User.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Not Found | - | +| **500** | Internal Server Error | - | + + +# **getMyPermissions** +> Permissions getMyPermissions() + +Get current user permissions + +Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.IamUsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + IamUsersApi apiInstance = new IamUsersApi(defaultClient); + try { + Permissions result = apiInstance.getMyPermissions(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IamUsersApi#getMyPermissions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Permissions**](Permissions.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **0** | Error | - | + diff --git a/docs/InviteUserInputBody.md b/docs/InviteUserInputBody.md new file mode 100644 index 0000000..18647f1 --- /dev/null +++ b/docs/InviteUserInputBody.md @@ -0,0 +1,18 @@ + + +# InviteUserInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**credits** | **Long** | Initial credit balance for the invited user in raw units (1 credit = 1000 units). | | +|**email** | **String** | Email address to invite | | +|**firstName** | **String** | First name included in the invite email and registration URL | | +|**lastName** | **String** | Last name pre-filled in the registration URL | [optional] | +|**teamId** | **Long** | Team to assign the invited user to | [optional] | +|**username** | **String** | Username pre-filled in the registration URL | [optional] | + + + diff --git a/docs/IssuerAllowedDomain.md b/docs/IssuerAllowedDomain.md new file mode 100644 index 0000000..e9d3af8 --- /dev/null +++ b/docs/IssuerAllowedDomain.md @@ -0,0 +1,18 @@ + + +# IssuerAllowedDomain + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**challengeToken** | **String** | DNS TXT challenge token. Add a TXT record at _reveng-verification.<domain> with this value. | [optional] | +|**createdAt** | **OffsetDateTime** | | | +|**domain** | **String** | Email domain (e.g. acme.com) | | +|**issuerAllowedDomainId** | **Long** | | | +|**organisationIssuerId** | **Long** | | | +|**verificationStatus** | **String** | Domain ownership verification status: PENDING, VERIFIED, or FAILED | | + + + diff --git a/docs/ListTeamsOutputBody.md b/docs/ListTeamsOutputBody.md new file mode 100644 index 0000000..eacedc1 --- /dev/null +++ b/docs/ListTeamsOutputBody.md @@ -0,0 +1,14 @@ + + +# ListTeamsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**teams** | [**List<Team>**](Team.md) | | | +|**total** | **Long** | | | + + + diff --git a/docs/ListUsersOutputBody.md b/docs/ListUsersOutputBody.md new file mode 100644 index 0000000..d66a4e9 --- /dev/null +++ b/docs/ListUsersOutputBody.md @@ -0,0 +1,14 @@ + + +# ListUsersOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**total** | **Long** | | | +|**users** | [**List<User>**](User.md) | | | + + + diff --git a/docs/LocationOutputBody.md b/docs/LocationOutputBody.md new file mode 100644 index 0000000..2f791b3 --- /dev/null +++ b/docs/LocationOutputBody.md @@ -0,0 +1,28 @@ + + +# LocationOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**country** | **String** | Country name | | +|**countryCode** | **String** | ISO 3166-1 alpha-2 country code | | +|**currency** | [**CurrencyEnum**](#CurrencyEnum) | Currency code for this location | | + + + +## Enum: CurrencyEnum + +| Name | Value | +|---- | -----| +| USD | "USD" | +| EUR | "EUR" | +| GBP | "GBP" | +| CAD | "CAD" | +| AUD | "AUD" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/MessageBody.md b/docs/MessageBody.md new file mode 100644 index 0000000..74f08c9 --- /dev/null +++ b/docs/MessageBody.md @@ -0,0 +1,13 @@ + + +# MessageBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**message** | **String** | Human-readable status message | | + + + diff --git a/docs/OIDCCallbackInputBody.md b/docs/OIDCCallbackInputBody.md new file mode 100644 index 0000000..99630d4 --- /dev/null +++ b/docs/OIDCCallbackInputBody.md @@ -0,0 +1,16 @@ + + +# OIDCCallbackInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | Authorization code from the identity provider | | +|**codeVerifier** | **String** | PKCE code verifier (the raw secret, not the challenge) | | +|**issuer** | **String** | OIDC issuer URL (as returned by the SSO providers endpoint) | | +|**redirectUri** | **String** | Redirect URI used when initiating the authorization request; must match exactly | | + + + diff --git a/docs/Organisation.md b/docs/Organisation.md new file mode 100644 index 0000000..e9d1a99 --- /dev/null +++ b/docs/Organisation.md @@ -0,0 +1,16 @@ + + +# Organisation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createdAt** | **OffsetDateTime** | | | +|**name** | **String** | Search is applied to string value | | +|**organisationId** | **Long** | | | +|**updatedAt** | **OffsetDateTime** | | | + + + diff --git a/docs/OrganisationGroup.md b/docs/OrganisationGroup.md new file mode 100644 index 0000000..b584747 --- /dev/null +++ b/docs/OrganisationGroup.md @@ -0,0 +1,18 @@ + + +# OrganisationGroup + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createdAt** | **OffsetDateTime** | | | +|**name** | **String** | Search is applied to string value | | +|**organisationGroupId** | **Long** | | | +|**organisationId** | **Long** | | | +|**teamId** | **Long** | | | +|**updatedAt** | **OffsetDateTime** | | | + + + diff --git a/docs/OrganisationIssuer.md b/docs/OrganisationIssuer.md new file mode 100644 index 0000000..0e55e83 --- /dev/null +++ b/docs/OrganisationIssuer.md @@ -0,0 +1,20 @@ + + +# OrganisationIssuer + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**clientId** | **String** | OIDC client ID registered with the identity provider. Used to validate the audience (aud) claim in JWTs. | [optional] | +|**createdAt** | **OffsetDateTime** | | | +|**enabled** | **Boolean** | | | +|**issuerUrl** | **String** | Search is applied to string value | | +|**jwksUri** | **String** | JSON Web Key Set URI discovered from the issuer's OIDC configuration. Populated automatically during issuer registration. | [optional] | +|**organisationId** | **Long** | | | +|**organisationIssuerId** | **Long** | | | +|**updatedAt** | **OffsetDateTime** | | | + + + diff --git a/docs/OrganisationOwner.md b/docs/OrganisationOwner.md new file mode 100644 index 0000000..b93ed15 --- /dev/null +++ b/docs/OrganisationOwner.md @@ -0,0 +1,16 @@ + + +# OrganisationOwner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createdAt** | **OffsetDateTime** | | | +|**organisationId** | **Long** | | | +|**organisationOwnerId** | **Long** | | | +|**userId** | **Long** | | | + + + diff --git a/docs/PasswordResetInputBody.md b/docs/PasswordResetInputBody.md new file mode 100644 index 0000000..8441d2e --- /dev/null +++ b/docs/PasswordResetInputBody.md @@ -0,0 +1,13 @@ + + +# PasswordResetInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | Email address of the account whose password should be reset | | + + + diff --git a/docs/Permissions.md b/docs/Permissions.md new file mode 100644 index 0000000..917e475 --- /dev/null +++ b/docs/Permissions.md @@ -0,0 +1,17 @@ + + +# Permissions + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**canExportSymbols** | **Boolean** | | | +|**canGeneratePdfReports** | **Boolean** | | | +|**canUseAiMalwareAnalysis** | **Boolean** | | | +|**canUseMalwareSandbox** | **Boolean** | | | +|**canUsePrivateAnalyses** | **Boolean** | | | + + + diff --git a/docs/RefreshBody.md b/docs/RefreshBody.md new file mode 100644 index 0000000..b0a5ece --- /dev/null +++ b/docs/RefreshBody.md @@ -0,0 +1,13 @@ + + +# RefreshBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**refreshToken** | **String** | The refresh token to rotate (falls back to refresh_token cookie if omitted) | [optional] | + + + diff --git a/docs/RegisterUserInputBody.md b/docs/RegisterUserInputBody.md new file mode 100644 index 0000000..dfd6602 --- /dev/null +++ b/docs/RegisterUserInputBody.md @@ -0,0 +1,18 @@ + + +# RegisterUserInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | Email address | | +|**firstName** | **String** | First name | | +|**inviteCode** | **String** | Invite code from the registration email | [optional] | +|**lastName** | **String** | Last name | | +|**password** | **String** | Password (minimum 10 characters) | | +|**username** | **String** | Username | | + + + diff --git a/docs/RevokeBody.md b/docs/RevokeBody.md new file mode 100644 index 0000000..881ab6a --- /dev/null +++ b/docs/RevokeBody.md @@ -0,0 +1,13 @@ + + +# RevokeBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**refreshToken** | **String** | The refresh token to revoke (falls back to refresh_token cookie if omitted) | [optional] | + + + diff --git a/docs/SSOProvider.md b/docs/SSOProvider.md new file mode 100644 index 0000000..6f30e80 --- /dev/null +++ b/docs/SSOProvider.md @@ -0,0 +1,14 @@ + + +# SSOProvider + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**authUrl** | **String** | Base authorization URL. Append code_challenge, code_challenge_method, redirect_uri, and state query parameters to complete the PKCE flow. | | +|**issuer** | **String** | Issuer URL of the identity provider. Pass this value as the issuer field in the SSO callback request. | | + + + diff --git a/docs/SSOProvidersOutputBody.md b/docs/SSOProvidersOutputBody.md new file mode 100644 index 0000000..a301751 --- /dev/null +++ b/docs/SSOProvidersOutputBody.md @@ -0,0 +1,13 @@ + + +# SSOProvidersOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**providers** | [**List<SSOProvider>**](SSOProvider.md) | | | + + + diff --git a/docs/Team.md b/docs/Team.md new file mode 100644 index 0000000..e836ea0 --- /dev/null +++ b/docs/Team.md @@ -0,0 +1,28 @@ + + +# Team + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**organisationId** | **Long** | Organisation this team belongs to, if any | [optional] | +|**plan** | [**PlanEnum**](#PlanEnum) | | | +|**teamId** | **Long** | | | +|**teamName** | **String** | | | + + + +## Enum: PlanEnum + +| Name | Value | +|---- | -----| +| FREE | "Free" | +| INDIVIDUAL | "Individual" | +| TESTER | "Tester" | +| ORGANISATION | "Organisation" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/TeamMember.md b/docs/TeamMember.md new file mode 100644 index 0000000..a9ee3a3 --- /dev/null +++ b/docs/TeamMember.md @@ -0,0 +1,29 @@ + + +# TeamMember + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | Search is applied to string value | | +|**isAdmin** | **Boolean** | | | +|**role** | [**RoleEnum**](#RoleEnum) | | | +|**userId** | **Long** | | | +|**username** | **String** | Search is applied to string value | | + + + +## Enum: RoleEnum + +| Name | Value | +|---- | -----| +| USER | "USER" | +| ADMIN | "ADMIN" | +| SUPERADMIN | "SUPERADMIN" | +| SYSTEM | "SYSTEM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/TokenInputBody.md b/docs/TokenInputBody.md new file mode 100644 index 0000000..32b9d69 --- /dev/null +++ b/docs/TokenInputBody.md @@ -0,0 +1,16 @@ + + +# TokenInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**apiKey** | **String** | API key to exchange for a JWT | [optional] | +|**email** | **String** | User email address (required with password) | [optional] | +|**password** | **String** | User password (required with email or username) | [optional] | +|**username** | **String** | Username (alternative to email, required with password) | [optional] | + + + diff --git a/docs/TokenResponse.md b/docs/TokenResponse.md new file mode 100644 index 0000000..9f0aee0 --- /dev/null +++ b/docs/TokenResponse.md @@ -0,0 +1,16 @@ + + +# TokenResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessToken** | **String** | Signed JWT access token | | +|**expiresIn** | **Long** | Access token lifetime in seconds | | +|**refreshToken** | **String** | Opaque refresh token for obtaining new access tokens | | +|**tokenType** | **String** | Token type (always Bearer) | | + + + diff --git a/docs/UpdateIssuerInputBody.md b/docs/UpdateIssuerInputBody.md new file mode 100644 index 0000000..50b9596 --- /dev/null +++ b/docs/UpdateIssuerInputBody.md @@ -0,0 +1,13 @@ + + +# UpdateIssuerInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enabled** | **Boolean** | Whether the issuer is enabled | | + + + diff --git a/docs/UpdateOrganisationInputBody.md b/docs/UpdateOrganisationInputBody.md new file mode 100644 index 0000000..1ab8012 --- /dev/null +++ b/docs/UpdateOrganisationInputBody.md @@ -0,0 +1,13 @@ + + +# UpdateOrganisationInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | New organisation name | | + + + diff --git a/docs/UpdatePasswordInputBody.md b/docs/UpdatePasswordInputBody.md new file mode 100644 index 0000000..42739c8 --- /dev/null +++ b/docs/UpdatePasswordInputBody.md @@ -0,0 +1,14 @@ + + +# UpdatePasswordInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | Password reset code received by email | | +|**password** | **String** | New password (minimum 10 characters) | | + + + diff --git a/docs/UpdateProfileInputBody.md b/docs/UpdateProfileInputBody.md new file mode 100644 index 0000000..0b14a29 --- /dev/null +++ b/docs/UpdateProfileInputBody.md @@ -0,0 +1,17 @@ + + +# UpdateProfileInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**defaultTeamId** | **Long** | Default team ID | [optional] | +|**firstName** | **String** | First name | [optional] | +|**lastName** | **String** | Last name | [optional] | +|**timeZone** | **String** | IANA time zone | [optional] | +|**username** | **String** | Username | [optional] | + + + diff --git a/docs/UpdateTeamInputBody.md b/docs/UpdateTeamInputBody.md new file mode 100644 index 0000000..ef82058 --- /dev/null +++ b/docs/UpdateTeamInputBody.md @@ -0,0 +1,13 @@ + + +# UpdateTeamInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**teamName** | **String** | Team name | [optional] | + + + diff --git a/docs/UpdateUserCreditsInputBody.md b/docs/UpdateUserCreditsInputBody.md new file mode 100644 index 0000000..0c863ba --- /dev/null +++ b/docs/UpdateUserCreditsInputBody.md @@ -0,0 +1,13 @@ + + +# UpdateUserCreditsInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**credits** | **Long** | Credit balance to set | | + + + diff --git a/docs/UpdateUserInputBody.md b/docs/UpdateUserInputBody.md new file mode 100644 index 0000000..9e194cc --- /dev/null +++ b/docs/UpdateUserInputBody.md @@ -0,0 +1,43 @@ + + +# UpdateUserInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | Email address | [optional] | +|**firstName** | **String** | First name | [optional] | +|**lastName** | **String** | Last name | [optional] | +|**role** | [**RoleEnum**](#RoleEnum) | User role (SUPERADMIN only) | [optional] | +|**tier** | [**TierEnum**](#TierEnum) | User tier (SUPERADMIN only) | [optional] | +|**timeZone** | **String** | IANA time zone | [optional] | +|**username** | **String** | Username | [optional] | + + + +## Enum: RoleEnum + +| Name | Value | +|---- | -----| +| USER | "USER" | +| ADMIN | "ADMIN" | +| SUPERADMIN | "SUPERADMIN" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: TierEnum + +| Name | Value | +|---- | -----| +| ENTHUSIAST | "ENTHUSIAST" | +| REVERSER | "REVERSER" | +| BUG_HUNTER | "BUG_HUNTER" | +| MALWARE_ANALYST | "MALWARE_ANALYST" | +| SECURITY_RESEARCHER | "SECURITY_RESEARCHER" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/UpdateUserPasswordInputBody.md b/docs/UpdateUserPasswordInputBody.md new file mode 100644 index 0000000..3729829 --- /dev/null +++ b/docs/UpdateUserPasswordInputBody.md @@ -0,0 +1,14 @@ + + +# UpdateUserPasswordInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**currentPassword** | **String** | Current password (required when changing your own password; ignored for SUPERADMIN updates of other users) | [optional] | +|**newPassword** | **String** | New password (minimum 10 characters) | | + + + diff --git a/docs/User.md b/docs/User.md new file mode 100644 index 0000000..5ec80da --- /dev/null +++ b/docs/User.md @@ -0,0 +1,43 @@ + + +# User + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createdAt** | **OffsetDateTime** | | [optional] | +|**email** | **String** | | | +|**profile** | [**UserProfile**](UserProfile.md) | | | +|**role** | [**RoleEnum**](#RoleEnum) | | | +|**tier** | [**TierEnum**](#TierEnum) | | [optional] | +|**userId** | **Long** | | | + + + +## Enum: RoleEnum + +| Name | Value | +|---- | -----| +| USER | "USER" | +| ADMIN | "ADMIN" | +| SUPERADMIN | "SUPERADMIN" | +| SYSTEM | "SYSTEM" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + +## Enum: TierEnum + +| Name | Value | +|---- | -----| +| ENTHUSIAST | "ENTHUSIAST" | +| REVERSER | "REVERSER" | +| BUG_HUNTER | "BUG_HUNTER" | +| MALWARE_ANALYST | "MALWARE_ANALYST" | +| SECURITY_RESEARCHER | "SECURITY_RESEARCHER" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/UserCredits.md b/docs/UserCredits.md new file mode 100644 index 0000000..d3a9e14 --- /dev/null +++ b/docs/UserCredits.md @@ -0,0 +1,16 @@ + + +# UserCredits + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createdAt** | **OffsetDateTime** | | [optional] | +|**credits** | **Long** | | | +|**updatedAt** | **OffsetDateTime** | | [optional] | +|**userId** | **Long** | | | + + + diff --git a/docs/UserIdentity.md b/docs/UserIdentity.md new file mode 100644 index 0000000..f5db973 --- /dev/null +++ b/docs/UserIdentity.md @@ -0,0 +1,18 @@ + + +# UserIdentity + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**createdAt** | **OffsetDateTime** | | | +|**issuerUrl** | **String** | Search is applied to string value | | +|**subject** | **String** | Search is applied to string value | | +|**updatedAt** | **OffsetDateTime** | | | +|**userId** | **Long** | | | +|**userIdentityId** | **Long** | | | + + + diff --git a/docs/UserProfile.md b/docs/UserProfile.md new file mode 100644 index 0000000..9e2f1c2 --- /dev/null +++ b/docs/UserProfile.md @@ -0,0 +1,17 @@ + + +# UserProfile + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**defaultTeamId** | **Long** | | [optional] | +|**firstName** | **String** | | | +|**lastName** | **String** | | | +|**timeZone** | **String** | | | +|**username** | **String** | | | + + + diff --git a/pom.xml b/pom.xml index d57dbbd..1773ea9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.96.2 + 3.96.3 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/IamUsersApi.java b/src/main/java/ai/reveng/api/IamUsersApi.java new file mode 100644 index 0000000..d443358 --- /dev/null +++ b/src/main/java/ai/reveng/api/IamUsersApi.java @@ -0,0 +1,322 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.api; + +import ai.reveng.invoker.ApiCallback; +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.ApiResponse; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.Pair; +import ai.reveng.invoker.ProgressRequestBody; +import ai.reveng.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import ai.reveng.model.APIError; +import ai.reveng.model.Permissions; +import ai.reveng.model.User; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class IamUsersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public IamUsersApi() { + this(Configuration.getDefaultApiClient()); + } + + public IamUsersApi(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 getMe + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
404 Not Found -
500 Internal Server Error -
+ */ + public okhttp3.Call getMeCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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/iam/me"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMeValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getMeCall(_callback); + + } + + /** + * Get current user + * Returns the authenticated user's own information. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
404 Not Found -
500 Internal Server Error -
+ */ + public User getMe() throws ApiException { + ApiResponse localVarResp = getMeWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get current user + * Returns the authenticated user's own information. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
404 Not Found -
500 Internal Server Error -
+ */ + public ApiResponse getMeWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getMeValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get current user (asynchronously) + * Returns the authenticated user's own information. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
404 Not Found -
500 Internal Server Error -
+ */ + public okhttp3.Call getMeAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMeValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getMyPermissions + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
0 Error -
+ */ + public okhttp3.Call getMyPermissionsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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/iam/me/permissions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMyPermissionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getMyPermissionsCall(_callback); + + } + + /** + * Get current user permissions + * Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + * @return Permissions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
0 Error -
+ */ + public Permissions getMyPermissions() throws ApiException { + ApiResponse localVarResp = getMyPermissionsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get current user permissions + * Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + * @return ApiResponse<Permissions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
0 Error -
+ */ + public ApiResponse getMyPermissionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getMyPermissionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get current user permissions (asynchronously) + * Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
0 Error -
+ */ + public okhttp3.Call getMyPermissionsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMyPermissionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 99d200f..86406df 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -146,7 +146,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.96.2/java"); + setUserAgent("OpenAPI-Generator/3.96.3/java"); authentications = new HashMap(); } diff --git a/src/main/java/ai/reveng/invoker/Configuration.java b/src/main/java/ai/reveng/invoker/Configuration.java index c9fa7ab..2bae968 100644 --- a/src/main/java/ai/reveng/invoker/Configuration.java +++ b/src/main/java/ai/reveng/invoker/Configuration.java @@ -18,7 +18,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "3.96.2"; + public static final String VERSION = "3.96.3"; private static final AtomicReference defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/src/main/java/ai/reveng/invoker/JSON.java b/src/main/java/ai/reveng/invoker/JSON.java index 8a1f86b..2e52547 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -103,6 +103,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AIDecompInverseStringMapItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.APIError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddCalleeInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddIssuerDomainInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddOwnerInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddTeamMemberInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringToFunctionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); @@ -230,6 +233,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryExternalsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkCreateUserResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkCreateUsersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkDeleteAnalysesRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CallEdge.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CallEdgesOutputBody.CustomTypeAdapterFactory()); @@ -272,7 +277,13 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCollectionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateCollectionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateConversationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateGroupInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateIdentityInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateIssuerInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateOrganisationInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreatePortalSessionInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateTeamInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateUserInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Created.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DataTypesEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompFailedEvent.CustomTypeAdapterFactory()); @@ -328,6 +339,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileActivityEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileHashes.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FormFile.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FuncDepsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionArgument.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlockDestinationResponse.CustomTypeAdapterFactory()); @@ -386,6 +398,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InlineComment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InsertAnalysisLogRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InviteUserInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IssuerAllowedDomain.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisFunctionsDataTypesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisFunctionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisStringsOutputBody.CustomTypeAdapterFactory()); @@ -393,12 +407,16 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionStringsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionsDataTypesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListTeamsOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListUsersOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.LocationOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Logs.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MITRETechnique.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MatchFilters.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MatchedFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MatchedFunctionSuggestion.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MemdumpEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MessageBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MetaModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ModelsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ModuleLoadEntry.CustomTypeAdapterFactory()); @@ -406,10 +424,16 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NameConfidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NameSourceType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkActivity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OIDCCallbackInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Organisation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OrganisationGroup.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OrganisationIssuer.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OrganisationOwner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PDBDebugModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PEModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PaginationModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Params.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PasswordResetInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionBinariesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionBinariesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionInputBody.CustomTypeAdapterFactory()); @@ -418,6 +442,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionTagsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCommentBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PcapBodyInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Permissions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PriceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PriceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProcessActivityEntry.CustomTypeAdapterFactory()); @@ -432,7 +457,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.QueuedWorkflowTaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReAnalysisForm.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Recent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RefreshBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RegenerateOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RegisterUserInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RegistryOperation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RelativeBinaryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameAppliedEvent.CustomTypeAdapterFactory()); @@ -443,8 +470,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RevokeBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SBOM.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SBOMPackage.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SSOProvider.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SSOProvidersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SandboxOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ScheduledTaskEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ScrapeThirdPartyConfig.CustomTypeAdapterFactory()); @@ -500,7 +530,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TaskStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TcpCarvedFile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Team.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TeamMember.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TimestampModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenisedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageFunctionResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageReportResponse.CustomTypeAdapterFactory()); @@ -509,11 +543,23 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TypeDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateDataTypesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateDataTypesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateIssuerInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateOrganisationInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdatePasswordInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateProfileInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateTeamInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateUserCreditsInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateUserInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateUserPasswordInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UploadResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertAiDecomplationRatingRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertOverridesData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertOverridesInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.User.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserActivityResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserCredits.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserIdentity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserProfile.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Vulnerabilities.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Vulnerability.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.WarningEvent.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AddIssuerDomainInputBody.java b/src/main/java/ai/reveng/model/AddIssuerDomainInputBody.java new file mode 100644 index 0000000..1dbaee8 --- /dev/null +++ b/src/main/java/ai/reveng/model/AddIssuerDomainInputBody.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * AddIssuerDomainInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddIssuerDomainInputBody { + public static final String SERIALIZED_NAME_DOMAIN = "domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nonnull + private String domain; + + public AddIssuerDomainInputBody() { + } + + public AddIssuerDomainInputBody domain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + return this; + } + + /** + * Email domain to allow (e.g. acme.com) + * @return domain + */ + @javax.annotation.Nonnull + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddIssuerDomainInputBody instance itself + */ + public AddIssuerDomainInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddIssuerDomainInputBody addIssuerDomainInputBody = (AddIssuerDomainInputBody) o; + return Objects.equals(this.domain, addIssuerDomainInputBody.domain)&& + Objects.equals(this.additionalProperties, addIssuerDomainInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(domain, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddIssuerDomainInputBody {\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("domain")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("domain")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AddIssuerDomainInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddIssuerDomainInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AddIssuerDomainInputBody is not found in the empty JSON string", AddIssuerDomainInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddIssuerDomainInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!AddIssuerDomainInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddIssuerDomainInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddIssuerDomainInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddIssuerDomainInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddIssuerDomainInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddIssuerDomainInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddIssuerDomainInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddIssuerDomainInputBody + * @throws IOException if the JSON string is invalid with respect to AddIssuerDomainInputBody + */ + public static AddIssuerDomainInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddIssuerDomainInputBody.class); + } + + /** + * Convert an instance of AddIssuerDomainInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AddOwnerInputBody.java b/src/main/java/ai/reveng/model/AddOwnerInputBody.java new file mode 100644 index 0000000..8f52a71 --- /dev/null +++ b/src/main/java/ai/reveng/model/AddOwnerInputBody.java @@ -0,0 +1,287 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * AddOwnerInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddOwnerInputBody { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public AddOwnerInputBody() { + } + + public AddOwnerInputBody userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * User ID to add as owner + * minimum: 1 + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddOwnerInputBody instance itself + */ + public AddOwnerInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOwnerInputBody addOwnerInputBody = (AddOwnerInputBody) o; + return Objects.equals(this.userId, addOwnerInputBody.userId)&& + Objects.equals(this.additionalProperties, addOwnerInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOwnerInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_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 AddOwnerInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddOwnerInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AddOwnerInputBody is not found in the empty JSON string", AddOwnerInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddOwnerInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!AddOwnerInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddOwnerInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddOwnerInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddOwnerInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddOwnerInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddOwnerInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddOwnerInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddOwnerInputBody + * @throws IOException if the JSON string is invalid with respect to AddOwnerInputBody + */ + public static AddOwnerInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddOwnerInputBody.class); + } + + /** + * Convert an instance of AddOwnerInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/AddTeamMemberInputBody.java b/src/main/java/ai/reveng/model/AddTeamMemberInputBody.java new file mode 100644 index 0000000..8c74529 --- /dev/null +++ b/src/main/java/ai/reveng/model/AddTeamMemberInputBody.java @@ -0,0 +1,287 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * AddTeamMemberInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddTeamMemberInputBody { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public AddTeamMemberInputBody() { + } + + public AddTeamMemberInputBody userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * User ID to add + * minimum: 1 + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddTeamMemberInputBody instance itself + */ + public AddTeamMemberInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddTeamMemberInputBody addTeamMemberInputBody = (AddTeamMemberInputBody) o; + return Objects.equals(this.userId, addTeamMemberInputBody.userId)&& + Objects.equals(this.additionalProperties, addTeamMemberInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddTeamMemberInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_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 AddTeamMemberInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddTeamMemberInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AddTeamMemberInputBody is not found in the empty JSON string", AddTeamMemberInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddTeamMemberInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!AddTeamMemberInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddTeamMemberInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddTeamMemberInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddTeamMemberInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddTeamMemberInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddTeamMemberInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddTeamMemberInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddTeamMemberInputBody + * @throws IOException if the JSON string is invalid with respect to AddTeamMemberInputBody + */ + public static AddTeamMemberInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddTeamMemberInputBody.class); + } + + /** + * Convert an instance of AddTeamMemberInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BulkCreateUserResult.java b/src/main/java/ai/reveng/model/BulkCreateUserResult.java new file mode 100644 index 0000000..7e5369b --- /dev/null +++ b/src/main/java/ai/reveng/model/BulkCreateUserResult.java @@ -0,0 +1,430 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.User; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * BulkCreateUserResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BulkCreateUserResult { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable + private String error; + + public static final String SERIALIZED_NAME_INDEX = "index"; + @SerializedName(SERIALIZED_NAME_INDEX) + @javax.annotation.Nonnull + private Long index; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + @javax.annotation.Nonnull + private Boolean success; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + @javax.annotation.Nullable + private User user; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public BulkCreateUserResult() { + } + + public BulkCreateUserResult email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Search is applied to string value + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public BulkCreateUserResult error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Error description; present on failure + * @return error + */ + @javax.annotation.Nullable + public String getError() { + return error; + } + + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + + public BulkCreateUserResult index(@javax.annotation.Nonnull Long index) { + this.index = index; + return this; + } + + /** + * 1-based row index in the CSV + * @return index + */ + @javax.annotation.Nonnull + public Long getIndex() { + return index; + } + + public void setIndex(@javax.annotation.Nonnull Long index) { + this.index = index; + } + + + public BulkCreateUserResult success(@javax.annotation.Nonnull Boolean success) { + this.success = success; + return this; + } + + /** + * Get success + * @return success + */ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + public void setSuccess(@javax.annotation.Nonnull Boolean success) { + this.success = success; + } + + + public BulkCreateUserResult user(@javax.annotation.Nullable User user) { + this.user = user; + return this; + } + + /** + * Created user; present on success + * @return user + */ + @javax.annotation.Nullable + public User getUser() { + return user; + } + + public void setUser(@javax.annotation.Nullable User user) { + this.user = user; + } + + + public BulkCreateUserResult username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Search is applied to string value + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BulkCreateUserResult instance itself + */ + public BulkCreateUserResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkCreateUserResult bulkCreateUserResult = (BulkCreateUserResult) o; + return Objects.equals(this.email, bulkCreateUserResult.email) && + Objects.equals(this.error, bulkCreateUserResult.error) && + Objects.equals(this.index, bulkCreateUserResult.index) && + Objects.equals(this.success, bulkCreateUserResult.success) && + Objects.equals(this.user, bulkCreateUserResult.user) && + Objects.equals(this.username, bulkCreateUserResult.username)&& + Objects.equals(this.additionalProperties, bulkCreateUserResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, error, index, success, user, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkCreateUserResult {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("email", "error", "index", "success", "user", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("email", "index", "success", "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 BulkCreateUserResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BulkCreateUserResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BulkCreateUserResult is not found in the empty JSON string", BulkCreateUserResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkCreateUserResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + // validate the optional field `user` + if (jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) { + User.validateJsonElement(jsonObj.get("user")); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!BulkCreateUserResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkCreateUserResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkCreateUserResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BulkCreateUserResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BulkCreateUserResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BulkCreateUserResult instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BulkCreateUserResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkCreateUserResult + * @throws IOException if the JSON string is invalid with respect to BulkCreateUserResult + */ + public static BulkCreateUserResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkCreateUserResult.class); + } + + /** + * Convert an instance of BulkCreateUserResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BulkCreateUsersOutputBody.java b/src/main/java/ai/reveng/model/BulkCreateUsersOutputBody.java new file mode 100644 index 0000000..c4da694 --- /dev/null +++ b/src/main/java/ai/reveng/model/BulkCreateUsersOutputBody.java @@ -0,0 +1,385 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.BulkCreateUserResult; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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 ai.reveng.invoker.JSON; + +/** + * BulkCreateUsersOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BulkCreateUsersOutputBody { + public static final String SERIALIZED_NAME_FAILED = "failed"; + @SerializedName(SERIALIZED_NAME_FAILED) + @javax.annotation.Nonnull + private Long failed; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nullable + private List results; + + public static final String SERIALIZED_NAME_SUCCEEDED = "succeeded"; + @SerializedName(SERIALIZED_NAME_SUCCEEDED) + @javax.annotation.Nonnull + private Long succeeded; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nonnull + private Long total; + + public BulkCreateUsersOutputBody() { + } + + public BulkCreateUsersOutputBody failed(@javax.annotation.Nonnull Long failed) { + this.failed = failed; + return this; + } + + /** + * Get failed + * @return failed + */ + @javax.annotation.Nonnull + public Long getFailed() { + return failed; + } + + public void setFailed(@javax.annotation.Nonnull Long failed) { + this.failed = failed; + } + + + public BulkCreateUsersOutputBody results(@javax.annotation.Nullable List results) { + this.results = results; + return this; + } + + public BulkCreateUsersOutputBody addResultsItem(BulkCreateUserResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + */ + @javax.annotation.Nullable + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nullable List results) { + this.results = results; + } + + + public BulkCreateUsersOutputBody succeeded(@javax.annotation.Nonnull Long succeeded) { + this.succeeded = succeeded; + return this; + } + + /** + * Get succeeded + * @return succeeded + */ + @javax.annotation.Nonnull + public Long getSucceeded() { + return succeeded; + } + + public void setSucceeded(@javax.annotation.Nonnull Long succeeded) { + this.succeeded = succeeded; + } + + + public BulkCreateUsersOutputBody total(@javax.annotation.Nonnull Long total) { + this.total = total; + return this; + } + + /** + * Get total + * @return total + */ + @javax.annotation.Nonnull + public Long getTotal() { + return total; + } + + public void setTotal(@javax.annotation.Nonnull Long total) { + this.total = total; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BulkCreateUsersOutputBody instance itself + */ + public BulkCreateUsersOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkCreateUsersOutputBody bulkCreateUsersOutputBody = (BulkCreateUsersOutputBody) o; + return Objects.equals(this.failed, bulkCreateUsersOutputBody.failed) && + Objects.equals(this.results, bulkCreateUsersOutputBody.results) && + Objects.equals(this.succeeded, bulkCreateUsersOutputBody.succeeded) && + Objects.equals(this.total, bulkCreateUsersOutputBody.total)&& + Objects.equals(this.additionalProperties, bulkCreateUsersOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(failed, results, succeeded, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkCreateUsersOutputBody {\n"); + sb.append(" failed: ").append(toIndentedString(failed)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("failed", "results", "succeeded", "total")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("failed", "results", "succeeded", "total")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BulkCreateUsersOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BulkCreateUsersOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BulkCreateUsersOutputBody is not found in the empty JSON string", BulkCreateUsersOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkCreateUsersOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + BulkCreateUserResult.validateJsonElement(jsonArrayresults.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BulkCreateUsersOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkCreateUsersOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkCreateUsersOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BulkCreateUsersOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BulkCreateUsersOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BulkCreateUsersOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BulkCreateUsersOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkCreateUsersOutputBody + * @throws IOException if the JSON string is invalid with respect to BulkCreateUsersOutputBody + */ + public static BulkCreateUsersOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkCreateUsersOutputBody.class); + } + + /** + * Convert an instance of BulkCreateUsersOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateGroupInputBody.java b/src/main/java/ai/reveng/model/CreateGroupInputBody.java new file mode 100644 index 0000000..6164fe2 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateGroupInputBody.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * CreateGroupInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateGroupInputBody { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public CreateGroupInputBody() { + } + + public CreateGroupInputBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Group name + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateGroupInputBody instance itself + */ + public CreateGroupInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateGroupInputBody createGroupInputBody = (CreateGroupInputBody) o; + return Objects.equals(this.name, createGroupInputBody.name)&& + Objects.equals(this.additionalProperties, createGroupInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateGroupInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 CreateGroupInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateGroupInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CreateGroupInputBody is not found in the empty JSON string", CreateGroupInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateGroupInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateGroupInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateGroupInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateGroupInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateGroupInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateGroupInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateGroupInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateGroupInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateGroupInputBody + * @throws IOException if the JSON string is invalid with respect to CreateGroupInputBody + */ + public static CreateGroupInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateGroupInputBody.class); + } + + /** + * Convert an instance of CreateGroupInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateIdentityInputBody.java b/src/main/java/ai/reveng/model/CreateIdentityInputBody.java new file mode 100644 index 0000000..7b04bc2 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateIdentityInputBody.java @@ -0,0 +1,345 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * CreateIdentityInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateIdentityInputBody { + public static final String SERIALIZED_NAME_ISSUER_URL = "issuer_url"; + @SerializedName(SERIALIZED_NAME_ISSUER_URL) + @javax.annotation.Nonnull + private String issuerUrl; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nonnull + private String subject; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public CreateIdentityInputBody() { + } + + public CreateIdentityInputBody issuerUrl(@javax.annotation.Nonnull String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * Issuer URL (must be trusted by this organisation) + * @return issuerUrl + */ + @javax.annotation.Nonnull + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(@javax.annotation.Nonnull String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + + public CreateIdentityInputBody subject(@javax.annotation.Nonnull String subject) { + this.subject = subject; + return this; + } + + /** + * External subject identifier from the issuer + * @return subject + */ + @javax.annotation.Nonnull + public String getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nonnull String subject) { + this.subject = subject; + } + + + public CreateIdentityInputBody userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Internal user ID to link + * minimum: 1 + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateIdentityInputBody instance itself + */ + public CreateIdentityInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateIdentityInputBody createIdentityInputBody = (CreateIdentityInputBody) o; + return Objects.equals(this.issuerUrl, createIdentityInputBody.issuerUrl) && + Objects.equals(this.subject, createIdentityInputBody.subject) && + Objects.equals(this.userId, createIdentityInputBody.userId)&& + Objects.equals(this.additionalProperties, createIdentityInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(issuerUrl, subject, userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateIdentityInputBody {\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("issuer_url", "subject", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("issuer_url", "subject", "user_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 CreateIdentityInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateIdentityInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CreateIdentityInputBody is not found in the empty JSON string", CreateIdentityInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateIdentityInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("issuer_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_url").toString())); + } + if (!jsonObj.get("subject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateIdentityInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateIdentityInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateIdentityInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateIdentityInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateIdentityInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateIdentityInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateIdentityInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateIdentityInputBody + * @throws IOException if the JSON string is invalid with respect to CreateIdentityInputBody + */ + public static CreateIdentityInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateIdentityInputBody.class); + } + + /** + * Convert an instance of CreateIdentityInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateIssuerInputBody.java b/src/main/java/ai/reveng/model/CreateIssuerInputBody.java new file mode 100644 index 0000000..40f036b --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateIssuerInputBody.java @@ -0,0 +1,318 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * CreateIssuerInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateIssuerInputBody { + 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_ISSUER_URL = "issuer_url"; + @SerializedName(SERIALIZED_NAME_ISSUER_URL) + @javax.annotation.Nonnull + private String issuerUrl; + + public CreateIssuerInputBody() { + } + + public CreateIssuerInputBody clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * OIDC client ID for audience validation (recommended) + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public CreateIssuerInputBody issuerUrl(@javax.annotation.Nonnull String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * OIDC issuer URL to trust + * @return issuerUrl + */ + @javax.annotation.Nonnull + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(@javax.annotation.Nonnull String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateIssuerInputBody instance itself + */ + public CreateIssuerInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateIssuerInputBody createIssuerInputBody = (CreateIssuerInputBody) o; + return Objects.equals(this.clientId, createIssuerInputBody.clientId) && + Objects.equals(this.issuerUrl, createIssuerInputBody.issuerUrl)&& + Objects.equals(this.additionalProperties, createIssuerInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, issuerUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateIssuerInputBody {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("client_id", "issuer_url")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("issuer_url")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateIssuerInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateIssuerInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CreateIssuerInputBody is not found in the empty JSON string", CreateIssuerInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateIssuerInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.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(java.util.Locale.ROOT, "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("issuer_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateIssuerInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateIssuerInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateIssuerInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateIssuerInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateIssuerInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateIssuerInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateIssuerInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateIssuerInputBody + * @throws IOException if the JSON string is invalid with respect to CreateIssuerInputBody + */ + public static CreateIssuerInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateIssuerInputBody.class); + } + + /** + * Convert an instance of CreateIssuerInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateOrganisationInputBody.java b/src/main/java/ai/reveng/model/CreateOrganisationInputBody.java new file mode 100644 index 0000000..97b210e --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateOrganisationInputBody.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * CreateOrganisationInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateOrganisationInputBody { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public CreateOrganisationInputBody() { + } + + public CreateOrganisationInputBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Organisation name + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateOrganisationInputBody instance itself + */ + public CreateOrganisationInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganisationInputBody createOrganisationInputBody = (CreateOrganisationInputBody) o; + return Objects.equals(this.name, createOrganisationInputBody.name)&& + Objects.equals(this.additionalProperties, createOrganisationInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrganisationInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 CreateOrganisationInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateOrganisationInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CreateOrganisationInputBody is not found in the empty JSON string", CreateOrganisationInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateOrganisationInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateOrganisationInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateOrganisationInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateOrganisationInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateOrganisationInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateOrganisationInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateOrganisationInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateOrganisationInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateOrganisationInputBody + * @throws IOException if the JSON string is invalid with respect to CreateOrganisationInputBody + */ + public static CreateOrganisationInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateOrganisationInputBody.class); + } + + /** + * Convert an instance of CreateOrganisationInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateTeamInputBody.java b/src/main/java/ai/reveng/model/CreateTeamInputBody.java new file mode 100644 index 0000000..8af55a1 --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateTeamInputBody.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * CreateTeamInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateTeamInputBody { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public CreateTeamInputBody() { + } + + public CreateTeamInputBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Team name + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateTeamInputBody instance itself + */ + public CreateTeamInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTeamInputBody createTeamInputBody = (CreateTeamInputBody) o; + return Objects.equals(this.name, createTeamInputBody.name)&& + Objects.equals(this.additionalProperties, createTeamInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTeamInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 CreateTeamInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateTeamInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CreateTeamInputBody is not found in the empty JSON string", CreateTeamInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTeamInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTeamInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTeamInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateTeamInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTeamInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateTeamInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateTeamInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTeamInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTeamInputBody + * @throws IOException if the JSON string is invalid with respect to CreateTeamInputBody + */ + public static CreateTeamInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTeamInputBody.class); + } + + /** + * Convert an instance of CreateTeamInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CreateUserInputBody.java b/src/main/java/ai/reveng/model/CreateUserInputBody.java new file mode 100644 index 0000000..28740ee --- /dev/null +++ b/src/main/java/ai/reveng/model/CreateUserInputBody.java @@ -0,0 +1,643 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * CreateUserInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUserInputBody { + public static final String SERIALIZED_NAME_CREDITS = "credits"; + @SerializedName(SERIALIZED_NAME_CREDITS) + @javax.annotation.Nullable + private Long credits; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_FIRST_NAME = "first_name"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + /** + * User role (defaults to USER) + */ + @JsonAdapter(RoleEnum.Adapter.class) + public enum RoleEnum { + USER("USER"), + + ADMIN("ADMIN"), + + SUPERADMIN("SUPERADMIN"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RoleEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RoleEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RoleEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RoleEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private RoleEnum role; + + /** + * User tier (defaults to ENTHUSIAST) + */ + @JsonAdapter(TierEnum.Adapter.class) + public enum TierEnum { + ENTHUSIAST("ENTHUSIAST"), + + REVERSER("REVERSER"), + + BUG_HUNTER("BUG_HUNTER"), + + MALWARE_ANALYST("MALWARE_ANALYST"), + + SECURITY_RESEARCHER("SECURITY_RESEARCHER"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TierEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TierEnum fromValue(String value) { + for (TierEnum b : TierEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TierEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TierEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TierEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TierEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + @javax.annotation.Nullable + private TierEnum tier; + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public CreateUserInputBody() { + } + + public CreateUserInputBody credits(@javax.annotation.Nullable Long credits) { + this.credits = credits; + return this; + } + + /** + * Initial credit balance in credits (1 credit = 1000 units); defaults to 10 credits + * minimum: 0 + * @return credits + */ + @javax.annotation.Nullable + public Long getCredits() { + return credits; + } + + public void setCredits(@javax.annotation.Nullable Long credits) { + this.credits = credits; + } + + + public CreateUserInputBody email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Email address + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public CreateUserInputBody firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public CreateUserInputBody lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public CreateUserInputBody password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Initial password + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public CreateUserInputBody role(@javax.annotation.Nullable RoleEnum role) { + this.role = role; + return this; + } + + /** + * User role (defaults to USER) + * @return role + */ + @javax.annotation.Nullable + public RoleEnum getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable RoleEnum role) { + this.role = role; + } + + + public CreateUserInputBody tier(@javax.annotation.Nullable TierEnum tier) { + this.tier = tier; + return this; + } + + /** + * User tier (defaults to ENTHUSIAST) + * @return tier + */ + @javax.annotation.Nullable + public TierEnum getTier() { + return tier; + } + + public void setTier(@javax.annotation.Nullable TierEnum tier) { + this.tier = tier; + } + + + public CreateUserInputBody timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * IANA time zone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public CreateUserInputBody username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateUserInputBody instance itself + */ + public CreateUserInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserInputBody createUserInputBody = (CreateUserInputBody) o; + return Objects.equals(this.credits, createUserInputBody.credits) && + Objects.equals(this.email, createUserInputBody.email) && + Objects.equals(this.firstName, createUserInputBody.firstName) && + Objects.equals(this.lastName, createUserInputBody.lastName) && + Objects.equals(this.password, createUserInputBody.password) && + Objects.equals(this.role, createUserInputBody.role) && + Objects.equals(this.tier, createUserInputBody.tier) && + Objects.equals(this.timeZone, createUserInputBody.timeZone) && + Objects.equals(this.username, createUserInputBody.username)&& + Objects.equals(this.additionalProperties, createUserInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credits, email, firstName, lastName, password, role, tier, timeZone, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUserInputBody {\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("credits", "email", "first_name", "last_name", "password", "role", "tier", "time_zone", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("email", "password", "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 CreateUserInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateUserInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CreateUserInputBody is not found in the empty JSON string", CreateUserInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateUserInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("first_name") != null && !jsonObj.get("first_name").isJsonNull()) && !jsonObj.get("first_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); + } + if ((jsonObj.get("last_name") != null && !jsonObj.get("last_name").isJsonNull()) && !jsonObj.get("last_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_name").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) && !jsonObj.get("role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role").toString())); + } + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + RoleEnum.validateJsonElement(jsonObj.get("role")); + } + if ((jsonObj.get("tier") != null && !jsonObj.get("tier").isJsonNull()) && !jsonObj.get("tier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tier").toString())); + } + // validate the optional field `tier` + if (jsonObj.get("tier") != null && !jsonObj.get("tier").isJsonNull()) { + TierEnum.validateJsonElement(jsonObj.get("tier")); + } + if ((jsonObj.get("time_zone") != null && !jsonObj.get("time_zone").isJsonNull()) && !jsonObj.get("time_zone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `time_zone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_zone").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateUserInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateUserInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateUserInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateUserInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateUserInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateUserInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateUserInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateUserInputBody + * @throws IOException if the JSON string is invalid with respect to CreateUserInputBody + */ + public static CreateUserInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateUserInputBody.class); + } + + /** + * Convert an instance of CreateUserInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FormFile.java b/src/main/java/ai/reveng/model/FormFile.java new file mode 100644 index 0000000..3fdf105 --- /dev/null +++ b/src/main/java/ai/reveng/model/FormFile.java @@ -0,0 +1,370 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * FormFile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FormFile { + public static final String SERIALIZED_NAME_CONTENT_TYPE = "ContentType"; + @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) + @javax.annotation.Nullable + private String contentType; + + public static final String SERIALIZED_NAME_FILENAME = "Filename"; + @SerializedName(SERIALIZED_NAME_FILENAME) + @javax.annotation.Nullable + private String filename; + + public static final String SERIALIZED_NAME_IS_SET = "IsSet"; + @SerializedName(SERIALIZED_NAME_IS_SET) + @javax.annotation.Nonnull + private Boolean isSet; + + public static final String SERIALIZED_NAME_SIZE = "Size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Long size; + + public FormFile() { + } + + public FormFile contentType(@javax.annotation.Nullable String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Search is applied to string value + * @return contentType + */ + @javax.annotation.Nullable + public String getContentType() { + return contentType; + } + + public void setContentType(@javax.annotation.Nullable String contentType) { + this.contentType = contentType; + } + + + public FormFile filename(@javax.annotation.Nullable String filename) { + this.filename = filename; + return this; + } + + /** + * Search is applied to string value + * @return filename + */ + @javax.annotation.Nullable + public String getFilename() { + return filename; + } + + public void setFilename(@javax.annotation.Nullable String filename) { + this.filename = filename; + } + + + public FormFile isSet(@javax.annotation.Nonnull Boolean isSet) { + this.isSet = isSet; + return this; + } + + /** + * Get isSet + * @return isSet + */ + @javax.annotation.Nonnull + public Boolean getIsSet() { + return isSet; + } + + public void setIsSet(@javax.annotation.Nonnull Boolean isSet) { + this.isSet = isSet; + } + + + public FormFile size(@javax.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Get size + * @return size + */ + @javax.annotation.Nonnull + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Long size) { + this.size = size; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FormFile instance itself + */ + public FormFile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormFile formFile = (FormFile) o; + return Objects.equals(this.contentType, formFile.contentType) && + Objects.equals(this.filename, formFile.filename) && + Objects.equals(this.isSet, formFile.isSet) && + Objects.equals(this.size, formFile.size)&& + Objects.equals(this.additionalProperties, formFile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(contentType, filename, isSet, size, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormFile {\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" isSet: ").append(toIndentedString(isSet)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("ContentType", "Filename", "IsSet", "Size")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("ContentType", "Filename", "IsSet", "Size")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FormFile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FormFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FormFile is not found in the empty JSON string", FormFile.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FormFile.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ContentType") != null && !jsonObj.get("ContentType").isJsonNull()) && !jsonObj.get("ContentType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ContentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ContentType").toString())); + } + if ((jsonObj.get("Filename") != null && !jsonObj.get("Filename").isJsonNull()) && !jsonObj.get("Filename").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `Filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Filename").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FormFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FormFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FormFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FormFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FormFile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FormFile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FormFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormFile + * @throws IOException if the JSON string is invalid with respect to FormFile + */ + public static FormFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FormFile.class); + } + + /** + * Convert an instance of FormFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/InviteUserInputBody.java b/src/main/java/ai/reveng/model/InviteUserInputBody.java new file mode 100644 index 0000000..bc153de --- /dev/null +++ b/src/main/java/ai/reveng/model/InviteUserInputBody.java @@ -0,0 +1,430 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * InviteUserInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InviteUserInputBody { + public static final String SERIALIZED_NAME_CREDITS = "credits"; + @SerializedName(SERIALIZED_NAME_CREDITS) + @javax.annotation.Nonnull + private Long credits; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_FIRST_NAME = "first_name"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nonnull + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nullable + private Long teamId; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public InviteUserInputBody() { + } + + public InviteUserInputBody credits(@javax.annotation.Nonnull Long credits) { + this.credits = credits; + return this; + } + + /** + * Initial credit balance for the invited user in raw units (1 credit = 1000 units). + * minimum: 0 + * @return credits + */ + @javax.annotation.Nonnull + public Long getCredits() { + return credits; + } + + public void setCredits(@javax.annotation.Nonnull Long credits) { + this.credits = credits; + } + + + public InviteUserInputBody email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Email address to invite + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public InviteUserInputBody firstName(@javax.annotation.Nonnull String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name included in the invite email and registration URL + * @return firstName + */ + @javax.annotation.Nonnull + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nonnull String firstName) { + this.firstName = firstName; + } + + + public InviteUserInputBody lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name pre-filled in the registration URL + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public InviteUserInputBody teamId(@javax.annotation.Nullable Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Team to assign the invited user to + * minimum: 1 + * @return teamId + */ + @javax.annotation.Nullable + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nullable Long teamId) { + this.teamId = teamId; + } + + + public InviteUserInputBody username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Username pre-filled in the registration URL + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the InviteUserInputBody instance itself + */ + public InviteUserInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InviteUserInputBody inviteUserInputBody = (InviteUserInputBody) o; + return Objects.equals(this.credits, inviteUserInputBody.credits) && + Objects.equals(this.email, inviteUserInputBody.email) && + Objects.equals(this.firstName, inviteUserInputBody.firstName) && + Objects.equals(this.lastName, inviteUserInputBody.lastName) && + Objects.equals(this.teamId, inviteUserInputBody.teamId) && + Objects.equals(this.username, inviteUserInputBody.username)&& + Objects.equals(this.additionalProperties, inviteUserInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credits, email, firstName, lastName, teamId, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InviteUserInputBody {\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("credits", "email", "first_name", "last_name", "team_id", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("credits", "email", "first_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 InviteUserInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InviteUserInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in InviteUserInputBody is not found in the empty JSON string", InviteUserInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InviteUserInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("first_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); + } + if ((jsonObj.get("last_name") != null && !jsonObj.get("last_name").isJsonNull()) && !jsonObj.get("last_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_name").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!InviteUserInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InviteUserInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InviteUserInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InviteUserInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public InviteUserInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InviteUserInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InviteUserInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of InviteUserInputBody + * @throws IOException if the JSON string is invalid with respect to InviteUserInputBody + */ + public static InviteUserInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InviteUserInputBody.class); + } + + /** + * Convert an instance of InviteUserInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/IssuerAllowedDomain.java b/src/main/java/ai/reveng/model/IssuerAllowedDomain.java new file mode 100644 index 0000000..43e186b --- /dev/null +++ b/src/main/java/ai/reveng/model/IssuerAllowedDomain.java @@ -0,0 +1,426 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * IssuerAllowedDomain + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IssuerAllowedDomain { + public static final String SERIALIZED_NAME_CHALLENGE_TOKEN = "challenge_token"; + @SerializedName(SERIALIZED_NAME_CHALLENGE_TOKEN) + @javax.annotation.Nullable + private String challengeToken; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DOMAIN = "domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nonnull + private String domain; + + public static final String SERIALIZED_NAME_ISSUER_ALLOWED_DOMAIN_ID = "issuer_allowed_domain_id"; + @SerializedName(SERIALIZED_NAME_ISSUER_ALLOWED_DOMAIN_ID) + @javax.annotation.Nonnull + private Long issuerAllowedDomainId; + + public static final String SERIALIZED_NAME_ORGANISATION_ISSUER_ID = "organisation_issuer_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_ISSUER_ID) + @javax.annotation.Nonnull + private Long organisationIssuerId; + + public static final String SERIALIZED_NAME_VERIFICATION_STATUS = "verification_status"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_STATUS) + @javax.annotation.Nonnull + private String verificationStatus; + + public IssuerAllowedDomain() { + } + + public IssuerAllowedDomain challengeToken(@javax.annotation.Nullable String challengeToken) { + this.challengeToken = challengeToken; + return this; + } + + /** + * DNS TXT challenge token. Add a TXT record at _reveng-verification.<domain> with this value. + * @return challengeToken + */ + @javax.annotation.Nullable + public String getChallengeToken() { + return challengeToken; + } + + public void setChallengeToken(@javax.annotation.Nullable String challengeToken) { + this.challengeToken = challengeToken; + } + + + public IssuerAllowedDomain createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public IssuerAllowedDomain domain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + return this; + } + + /** + * Email domain (e.g. acme.com) + * @return domain + */ + @javax.annotation.Nonnull + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + } + + + public IssuerAllowedDomain issuerAllowedDomainId(@javax.annotation.Nonnull Long issuerAllowedDomainId) { + this.issuerAllowedDomainId = issuerAllowedDomainId; + return this; + } + + /** + * Get issuerAllowedDomainId + * @return issuerAllowedDomainId + */ + @javax.annotation.Nonnull + public Long getIssuerAllowedDomainId() { + return issuerAllowedDomainId; + } + + public void setIssuerAllowedDomainId(@javax.annotation.Nonnull Long issuerAllowedDomainId) { + this.issuerAllowedDomainId = issuerAllowedDomainId; + } + + + public IssuerAllowedDomain organisationIssuerId(@javax.annotation.Nonnull Long organisationIssuerId) { + this.organisationIssuerId = organisationIssuerId; + return this; + } + + /** + * Get organisationIssuerId + * @return organisationIssuerId + */ + @javax.annotation.Nonnull + public Long getOrganisationIssuerId() { + return organisationIssuerId; + } + + public void setOrganisationIssuerId(@javax.annotation.Nonnull Long organisationIssuerId) { + this.organisationIssuerId = organisationIssuerId; + } + + + public IssuerAllowedDomain verificationStatus(@javax.annotation.Nonnull String verificationStatus) { + this.verificationStatus = verificationStatus; + return this; + } + + /** + * Domain ownership verification status: PENDING, VERIFIED, or FAILED + * @return verificationStatus + */ + @javax.annotation.Nonnull + public String getVerificationStatus() { + return verificationStatus; + } + + public void setVerificationStatus(@javax.annotation.Nonnull String verificationStatus) { + this.verificationStatus = verificationStatus; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IssuerAllowedDomain instance itself + */ + public IssuerAllowedDomain putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuerAllowedDomain issuerAllowedDomain = (IssuerAllowedDomain) o; + return Objects.equals(this.challengeToken, issuerAllowedDomain.challengeToken) && + Objects.equals(this.createdAt, issuerAllowedDomain.createdAt) && + Objects.equals(this.domain, issuerAllowedDomain.domain) && + Objects.equals(this.issuerAllowedDomainId, issuerAllowedDomain.issuerAllowedDomainId) && + Objects.equals(this.organisationIssuerId, issuerAllowedDomain.organisationIssuerId) && + Objects.equals(this.verificationStatus, issuerAllowedDomain.verificationStatus)&& + Objects.equals(this.additionalProperties, issuerAllowedDomain.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(challengeToken, createdAt, domain, issuerAllowedDomainId, organisationIssuerId, verificationStatus, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuerAllowedDomain {\n"); + sb.append(" challengeToken: ").append(toIndentedString(challengeToken)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" issuerAllowedDomainId: ").append(toIndentedString(issuerAllowedDomainId)).append("\n"); + sb.append(" organisationIssuerId: ").append(toIndentedString(organisationIssuerId)).append("\n"); + sb.append(" verificationStatus: ").append(toIndentedString(verificationStatus)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("challenge_token", "created_at", "domain", "issuer_allowed_domain_id", "organisation_issuer_id", "verification_status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "domain", "issuer_allowed_domain_id", "organisation_issuer_id", "verification_status")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IssuerAllowedDomain + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IssuerAllowedDomain.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in IssuerAllowedDomain is not found in the empty JSON string", IssuerAllowedDomain.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IssuerAllowedDomain.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("challenge_token") != null && !jsonObj.get("challenge_token").isJsonNull()) && !jsonObj.get("challenge_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `challenge_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challenge_token").toString())); + } + if (!jsonObj.get("domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString())); + } + if (!jsonObj.get("verification_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `verification_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IssuerAllowedDomain.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IssuerAllowedDomain' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IssuerAllowedDomain.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IssuerAllowedDomain value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IssuerAllowedDomain read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IssuerAllowedDomain instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IssuerAllowedDomain given an JSON string + * + * @param jsonString JSON string + * @return An instance of IssuerAllowedDomain + * @throws IOException if the JSON string is invalid with respect to IssuerAllowedDomain + */ + public static IssuerAllowedDomain fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IssuerAllowedDomain.class); + } + + /** + * Convert an instance of IssuerAllowedDomain to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListTeamsOutputBody.java b/src/main/java/ai/reveng/model/ListTeamsOutputBody.java new file mode 100644 index 0000000..932162d --- /dev/null +++ b/src/main/java/ai/reveng/model/ListTeamsOutputBody.java @@ -0,0 +1,333 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.Team; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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 ai.reveng.invoker.JSON; + +/** + * ListTeamsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListTeamsOutputBody { + public static final String SERIALIZED_NAME_TEAMS = "teams"; + @SerializedName(SERIALIZED_NAME_TEAMS) + @javax.annotation.Nullable + private List teams; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nonnull + private Long total; + + public ListTeamsOutputBody() { + } + + public ListTeamsOutputBody teams(@javax.annotation.Nullable List teams) { + this.teams = teams; + return this; + } + + public ListTeamsOutputBody addTeamsItem(Team teamsItem) { + if (this.teams == null) { + this.teams = new ArrayList<>(); + } + this.teams.add(teamsItem); + return this; + } + + /** + * Get teams + * @return teams + */ + @javax.annotation.Nullable + public List getTeams() { + return teams; + } + + public void setTeams(@javax.annotation.Nullable List teams) { + this.teams = teams; + } + + + public ListTeamsOutputBody total(@javax.annotation.Nonnull Long total) { + this.total = total; + return this; + } + + /** + * Get total + * @return total + */ + @javax.annotation.Nonnull + public Long getTotal() { + return total; + } + + public void setTotal(@javax.annotation.Nonnull Long total) { + this.total = total; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ListTeamsOutputBody instance itself + */ + public ListTeamsOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTeamsOutputBody listTeamsOutputBody = (ListTeamsOutputBody) o; + return Objects.equals(this.teams, listTeamsOutputBody.teams) && + Objects.equals(this.total, listTeamsOutputBody.total)&& + Objects.equals(this.additionalProperties, listTeamsOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(teams, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTeamsOutputBody {\n"); + sb.append(" teams: ").append(toIndentedString(teams)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("teams", "total")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("teams", "total")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListTeamsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListTeamsOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ListTeamsOutputBody is not found in the empty JSON string", ListTeamsOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTeamsOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("teams") != null && !jsonObj.get("teams").isJsonNull()) { + if (!jsonObj.get("teams").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `teams` to be an array in the JSON string but got `%s`", jsonObj.get("teams").toString())); + } + JsonArray jsonArrayteams = jsonObj.getAsJsonArray("teams"); + // validate the required field `teams` (array) + for (int i = 0; i < jsonArrayteams.size(); i++) { + Team.validateJsonElement(jsonArrayteams.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTeamsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTeamsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListTeamsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTeamsOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ListTeamsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListTeamsOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListTeamsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTeamsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListTeamsOutputBody + */ + public static ListTeamsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTeamsOutputBody.class); + } + + /** + * Convert an instance of ListTeamsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListUsersOutputBody.java b/src/main/java/ai/reveng/model/ListUsersOutputBody.java new file mode 100644 index 0000000..25fe92f --- /dev/null +++ b/src/main/java/ai/reveng/model/ListUsersOutputBody.java @@ -0,0 +1,333 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.User; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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 ai.reveng.invoker.JSON; + +/** + * ListUsersOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListUsersOutputBody { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nonnull + private Long total; + + public static final String SERIALIZED_NAME_USERS = "users"; + @SerializedName(SERIALIZED_NAME_USERS) + @javax.annotation.Nullable + private List users; + + public ListUsersOutputBody() { + } + + public ListUsersOutputBody total(@javax.annotation.Nonnull Long total) { + this.total = total; + return this; + } + + /** + * Get total + * @return total + */ + @javax.annotation.Nonnull + public Long getTotal() { + return total; + } + + public void setTotal(@javax.annotation.Nonnull Long total) { + this.total = total; + } + + + public ListUsersOutputBody users(@javax.annotation.Nullable List users) { + this.users = users; + return this; + } + + public ListUsersOutputBody addUsersItem(User usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get users + * @return users + */ + @javax.annotation.Nullable + public List getUsers() { + return users; + } + + public void setUsers(@javax.annotation.Nullable List users) { + this.users = users; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ListUsersOutputBody instance itself + */ + public ListUsersOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListUsersOutputBody listUsersOutputBody = (ListUsersOutputBody) o; + return Objects.equals(this.total, listUsersOutputBody.total) && + Objects.equals(this.users, listUsersOutputBody.users)&& + Objects.equals(this.additionalProperties, listUsersOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(total, users, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListUsersOutputBody {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("total", "users")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("total", "users")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListUsersOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListUsersOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ListUsersOutputBody is not found in the empty JSON string", ListUsersOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListUsersOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("users") != null && !jsonObj.get("users").isJsonNull()) { + if (!jsonObj.get("users").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + } + JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); + // validate the required field `users` (array) + for (int i = 0; i < jsonArrayusers.size(); i++) { + User.validateJsonElement(jsonArrayusers.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListUsersOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListUsersOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListUsersOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListUsersOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ListUsersOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListUsersOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListUsersOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListUsersOutputBody + * @throws IOException if the JSON string is invalid with respect to ListUsersOutputBody + */ + public static ListUsersOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListUsersOutputBody.class); + } + + /** + * Convert an instance of ListUsersOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/LocationOutputBody.java b/src/main/java/ai/reveng/model/LocationOutputBody.java new file mode 100644 index 0000000..6aafee0 --- /dev/null +++ b/src/main/java/ai/reveng/model/LocationOutputBody.java @@ -0,0 +1,409 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * LocationOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LocationOutputBody { + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nonnull + private String country; + + public static final String SERIALIZED_NAME_COUNTRY_CODE = "country_code"; + @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) + @javax.annotation.Nonnull + private String countryCode; + + /** + * Currency code for this location + */ + @JsonAdapter(CurrencyEnum.Adapter.class) + public enum CurrencyEnum { + USD("USD"), + + EUR("EUR"), + + GBP("GBP"), + + CAD("CAD"), + + AUD("AUD"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CurrencyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CurrencyEnum fromValue(String value) { + for (CurrencyEnum b : CurrencyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CurrencyEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CurrencyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CurrencyEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CurrencyEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nonnull + private CurrencyEnum currency; + + public LocationOutputBody() { + } + + public LocationOutputBody country(@javax.annotation.Nonnull String country) { + this.country = country; + return this; + } + + /** + * Country name + * @return country + */ + @javax.annotation.Nonnull + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nonnull String country) { + this.country = country; + } + + + public LocationOutputBody countryCode(@javax.annotation.Nonnull String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * ISO 3166-1 alpha-2 country code + * @return countryCode + */ + @javax.annotation.Nonnull + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(@javax.annotation.Nonnull String countryCode) { + this.countryCode = countryCode; + } + + + public LocationOutputBody currency(@javax.annotation.Nonnull CurrencyEnum currency) { + this.currency = currency; + return this; + } + + /** + * Currency code for this location + * @return currency + */ + @javax.annotation.Nonnull + public CurrencyEnum getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nonnull CurrencyEnum currency) { + this.currency = currency; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LocationOutputBody instance itself + */ + public LocationOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocationOutputBody locationOutputBody = (LocationOutputBody) o; + return Objects.equals(this.country, locationOutputBody.country) && + Objects.equals(this.countryCode, locationOutputBody.countryCode) && + Objects.equals(this.currency, locationOutputBody.currency)&& + Objects.equals(this.additionalProperties, locationOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(country, countryCode, currency, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LocationOutputBody {\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("country", "country_code", "currency")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("country", "country_code", "currency")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LocationOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LocationOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in LocationOutputBody is not found in the empty JSON string", LocationOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LocationOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if (!jsonObj.get("country_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `country_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country_code").toString())); + } + if (!jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + // validate the required field `currency` + CurrencyEnum.validateJsonElement(jsonObj.get("currency")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LocationOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LocationOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LocationOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LocationOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LocationOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LocationOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LocationOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of LocationOutputBody + * @throws IOException if the JSON string is invalid with respect to LocationOutputBody + */ + public static LocationOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LocationOutputBody.class); + } + + /** + * Convert an instance of LocationOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/MessageBody.java b/src/main/java/ai/reveng/model/MessageBody.java new file mode 100644 index 0000000..3adb96e --- /dev/null +++ b/src/main/java/ai/reveng/model/MessageBody.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * MessageBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MessageBody { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public MessageBody() { + } + + public MessageBody message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * Human-readable status message + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MessageBody instance itself + */ + public MessageBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageBody messageBody = (MessageBody) o; + return Objects.equals(this.message, messageBody.message)&& + Objects.equals(this.additionalProperties, messageBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("message")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 MessageBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MessageBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in MessageBody is not found in the empty JSON string", MessageBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MessageBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!MessageBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MessageBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MessageBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MessageBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MessageBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MessageBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MessageBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of MessageBody + * @throws IOException if the JSON string is invalid with respect to MessageBody + */ + public static MessageBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MessageBody.class); + } + + /** + * Convert an instance of MessageBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/OIDCCallbackInputBody.java b/src/main/java/ai/reveng/model/OIDCCallbackInputBody.java new file mode 100644 index 0000000..c2ff227 --- /dev/null +++ b/src/main/java/ai/reveng/model/OIDCCallbackInputBody.java @@ -0,0 +1,376 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * OIDCCallbackInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OIDCCallbackInputBody { + 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_ISSUER = "issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nonnull + private String issuer; + + public static final String SERIALIZED_NAME_REDIRECT_URI = "redirect_uri"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URI) + @javax.annotation.Nonnull + private String redirectUri; + + public OIDCCallbackInputBody() { + } + + public OIDCCallbackInputBody code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * Authorization code from the identity provider + * @return code + */ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + + public OIDCCallbackInputBody codeVerifier(@javax.annotation.Nonnull String codeVerifier) { + this.codeVerifier = codeVerifier; + return this; + } + + /** + * PKCE code verifier (the raw secret, not the challenge) + * @return codeVerifier + */ + @javax.annotation.Nonnull + public String getCodeVerifier() { + return codeVerifier; + } + + public void setCodeVerifier(@javax.annotation.Nonnull String codeVerifier) { + this.codeVerifier = codeVerifier; + } + + + public OIDCCallbackInputBody issuer(@javax.annotation.Nonnull String issuer) { + this.issuer = issuer; + return this; + } + + /** + * OIDC issuer URL (as returned by the SSO providers endpoint) + * @return issuer + */ + @javax.annotation.Nonnull + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nonnull String issuer) { + this.issuer = issuer; + } + + + public OIDCCallbackInputBody redirectUri(@javax.annotation.Nonnull String redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + * Redirect URI used when initiating the authorization request; must match exactly + * @return redirectUri + */ + @javax.annotation.Nonnull + public String getRedirectUri() { + return redirectUri; + } + + public void setRedirectUri(@javax.annotation.Nonnull String redirectUri) { + this.redirectUri = 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCCallbackInputBody instance itself + */ + public OIDCCallbackInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCCallbackInputBody oiDCCallbackInputBody = (OIDCCallbackInputBody) o; + return Objects.equals(this.code, oiDCCallbackInputBody.code) && + Objects.equals(this.codeVerifier, oiDCCallbackInputBody.codeVerifier) && + Objects.equals(this.issuer, oiDCCallbackInputBody.issuer) && + Objects.equals(this.redirectUri, oiDCCallbackInputBody.redirectUri)&& + Objects.equals(this.additionalProperties, oiDCCallbackInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, codeVerifier, issuer, redirectUri, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCCallbackInputBody {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" codeVerifier: ").append(toIndentedString(codeVerifier)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("code", "code_verifier", "issuer", "redirect_uri")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("code", "code_verifier", "issuer", "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 OIDCCallbackInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCCallbackInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in OIDCCallbackInputBody is not found in the empty JSON string", OIDCCallbackInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OIDCCallbackInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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("issuer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + } + if (!jsonObj.get("redirect_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `redirect_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_uri").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OIDCCallbackInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCCallbackInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCCallbackInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OIDCCallbackInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCCallbackInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCCallbackInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCCallbackInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCCallbackInputBody + * @throws IOException if the JSON string is invalid with respect to OIDCCallbackInputBody + */ + public static OIDCCallbackInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCCallbackInputBody.class); + } + + /** + * Convert an instance of OIDCCallbackInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/Organisation.java b/src/main/java/ai/reveng/model/Organisation.java new file mode 100644 index 0000000..0324b3b --- /dev/null +++ b/src/main/java/ai/reveng/model/Organisation.java @@ -0,0 +1,368 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * Organisation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Organisation { + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ORGANISATION_ID = "organisation_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_ID) + @javax.annotation.Nonnull + private Long organisationId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public Organisation() { + } + + public Organisation createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Organisation name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Search is applied to string value + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public Organisation organisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + return this; + } + + /** + * Get organisationId + * @return organisationId + */ + @javax.annotation.Nonnull + public Long getOrganisationId() { + return organisationId; + } + + public void setOrganisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + } + + + public Organisation updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Organisation instance itself + */ + public Organisation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Organisation organisation = (Organisation) o; + return Objects.equals(this.createdAt, organisation.createdAt) && + Objects.equals(this.name, organisation.name) && + Objects.equals(this.organisationId, organisation.organisationId) && + Objects.equals(this.updatedAt, organisation.updatedAt)&& + Objects.equals(this.additionalProperties, organisation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, name, organisationId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Organisation {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" organisationId: ").append(toIndentedString(organisationId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("created_at", "name", "organisation_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "name", "organisation_id", "updated_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Organisation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Organisation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Organisation is not found in the empty JSON string", Organisation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Organisation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!Organisation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Organisation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Organisation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Organisation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Organisation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Organisation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Organisation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Organisation + * @throws IOException if the JSON string is invalid with respect to Organisation + */ + public static Organisation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Organisation.class); + } + + /** + * Convert an instance of Organisation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/OrganisationGroup.java b/src/main/java/ai/reveng/model/OrganisationGroup.java new file mode 100644 index 0000000..1d01dc8 --- /dev/null +++ b/src/main/java/ai/reveng/model/OrganisationGroup.java @@ -0,0 +1,420 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * OrganisationGroup + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OrganisationGroup { + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ORGANISATION_GROUP_ID = "organisation_group_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_GROUP_ID) + @javax.annotation.Nonnull + private Long organisationGroupId; + + public static final String SERIALIZED_NAME_ORGANISATION_ID = "organisation_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_ID) + @javax.annotation.Nonnull + private Long organisationId; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public OrganisationGroup() { + } + + public OrganisationGroup createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public OrganisationGroup name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Search is applied to string value + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public OrganisationGroup organisationGroupId(@javax.annotation.Nonnull Long organisationGroupId) { + this.organisationGroupId = organisationGroupId; + return this; + } + + /** + * Get organisationGroupId + * @return organisationGroupId + */ + @javax.annotation.Nonnull + public Long getOrganisationGroupId() { + return organisationGroupId; + } + + public void setOrganisationGroupId(@javax.annotation.Nonnull Long organisationGroupId) { + this.organisationGroupId = organisationGroupId; + } + + + public OrganisationGroup organisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + return this; + } + + /** + * Get organisationId + * @return organisationId + */ + @javax.annotation.Nonnull + public Long getOrganisationId() { + return organisationId; + } + + public void setOrganisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + } + + + public OrganisationGroup teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Get teamId + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public OrganisationGroup updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganisationGroup instance itself + */ + public OrganisationGroup putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganisationGroup organisationGroup = (OrganisationGroup) o; + return Objects.equals(this.createdAt, organisationGroup.createdAt) && + Objects.equals(this.name, organisationGroup.name) && + Objects.equals(this.organisationGroupId, organisationGroup.organisationGroupId) && + Objects.equals(this.organisationId, organisationGroup.organisationId) && + Objects.equals(this.teamId, organisationGroup.teamId) && + Objects.equals(this.updatedAt, organisationGroup.updatedAt)&& + Objects.equals(this.additionalProperties, organisationGroup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, name, organisationGroupId, organisationId, teamId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganisationGroup {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" organisationGroupId: ").append(toIndentedString(organisationGroupId)).append("\n"); + sb.append(" organisationId: ").append(toIndentedString(organisationId)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("created_at", "name", "organisation_group_id", "organisation_id", "team_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "name", "organisation_group_id", "organisation_id", "team_id", "updated_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganisationGroup + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganisationGroup.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in OrganisationGroup is not found in the empty JSON string", OrganisationGroup.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganisationGroup.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganisationGroup.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganisationGroup' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganisationGroup.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganisationGroup value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganisationGroup read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganisationGroup instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganisationGroup given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganisationGroup + * @throws IOException if the JSON string is invalid with respect to OrganisationGroup + */ + public static OrganisationGroup fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganisationGroup.class); + } + + /** + * Convert an instance of OrganisationGroup to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/OrganisationIssuer.java b/src/main/java/ai/reveng/model/OrganisationIssuer.java new file mode 100644 index 0000000..b531810 --- /dev/null +++ b/src/main/java/ai/reveng/model/OrganisationIssuer.java @@ -0,0 +1,478 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * OrganisationIssuer + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OrganisationIssuer { + 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_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nonnull + private Boolean enabled; + + public static final String SERIALIZED_NAME_ISSUER_URL = "issuer_url"; + @SerializedName(SERIALIZED_NAME_ISSUER_URL) + @javax.annotation.Nullable + private String issuerUrl; + + 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_ORGANISATION_ID = "organisation_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_ID) + @javax.annotation.Nonnull + private Long organisationId; + + public static final String SERIALIZED_NAME_ORGANISATION_ISSUER_ID = "organisation_issuer_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_ISSUER_ID) + @javax.annotation.Nonnull + private Long organisationIssuerId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public OrganisationIssuer() { + } + + public OrganisationIssuer clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * OIDC client ID registered with the identity provider. Used to validate the audience (aud) claim in JWTs. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OrganisationIssuer createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public OrganisationIssuer enabled(@javax.annotation.Nonnull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nonnull Boolean enabled) { + this.enabled = enabled; + } + + + public OrganisationIssuer issuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * Search is applied to string value + * @return issuerUrl + */ + @javax.annotation.Nullable + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + + public OrganisationIssuer jwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + /** + * JSON Web Key Set URI discovered from the issuer's OIDC configuration. Populated automatically during issuer registration. + * @return jwksUri + */ + @javax.annotation.Nullable + public String getJwksUri() { + return jwksUri; + } + + public void setJwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + } + + + public OrganisationIssuer organisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + return this; + } + + /** + * Get organisationId + * @return organisationId + */ + @javax.annotation.Nonnull + public Long getOrganisationId() { + return organisationId; + } + + public void setOrganisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + } + + + public OrganisationIssuer organisationIssuerId(@javax.annotation.Nonnull Long organisationIssuerId) { + this.organisationIssuerId = organisationIssuerId; + return this; + } + + /** + * Get organisationIssuerId + * @return organisationIssuerId + */ + @javax.annotation.Nonnull + public Long getOrganisationIssuerId() { + return organisationIssuerId; + } + + public void setOrganisationIssuerId(@javax.annotation.Nonnull Long organisationIssuerId) { + this.organisationIssuerId = organisationIssuerId; + } + + + public OrganisationIssuer updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganisationIssuer instance itself + */ + public OrganisationIssuer putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganisationIssuer organisationIssuer = (OrganisationIssuer) o; + return Objects.equals(this.clientId, organisationIssuer.clientId) && + Objects.equals(this.createdAt, organisationIssuer.createdAt) && + Objects.equals(this.enabled, organisationIssuer.enabled) && + Objects.equals(this.issuerUrl, organisationIssuer.issuerUrl) && + Objects.equals(this.jwksUri, organisationIssuer.jwksUri) && + Objects.equals(this.organisationId, organisationIssuer.organisationId) && + Objects.equals(this.organisationIssuerId, organisationIssuer.organisationIssuerId) && + Objects.equals(this.updatedAt, organisationIssuer.updatedAt)&& + Objects.equals(this.additionalProperties, organisationIssuer.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, createdAt, enabled, issuerUrl, jwksUri, organisationId, organisationIssuerId, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganisationIssuer {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).append("\n"); + sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); + sb.append(" organisationId: ").append(toIndentedString(organisationId)).append("\n"); + sb.append(" organisationIssuerId: ").append(toIndentedString(organisationIssuerId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("client_id", "created_at", "enabled", "issuer_url", "jwks_uri", "organisation_id", "organisation_issuer_id", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "enabled", "issuer_url", "organisation_id", "organisation_issuer_id", "updated_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganisationIssuer + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganisationIssuer.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in OrganisationIssuer is not found in the empty JSON string", OrganisationIssuer.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganisationIssuer.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.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(java.util.Locale.ROOT, "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("issuer_url") != null && !jsonObj.get("issuer_url").isJsonNull()) && !jsonObj.get("issuer_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_url").toString())); + } + if ((jsonObj.get("jwks_uri") != null && !jsonObj.get("jwks_uri").isJsonNull()) && !jsonObj.get("jwks_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `jwks_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwks_uri").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganisationIssuer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganisationIssuer' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganisationIssuer.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganisationIssuer value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganisationIssuer read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganisationIssuer instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganisationIssuer given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganisationIssuer + * @throws IOException if the JSON string is invalid with respect to OrganisationIssuer + */ + public static OrganisationIssuer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganisationIssuer.class); + } + + /** + * Convert an instance of OrganisationIssuer to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/OrganisationOwner.java b/src/main/java/ai/reveng/model/OrganisationOwner.java new file mode 100644 index 0000000..ddc5733 --- /dev/null +++ b/src/main/java/ai/reveng/model/OrganisationOwner.java @@ -0,0 +1,365 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * OrganisationOwner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OrganisationOwner { + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ORGANISATION_ID = "organisation_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_ID) + @javax.annotation.Nonnull + private Long organisationId; + + public static final String SERIALIZED_NAME_ORGANISATION_OWNER_ID = "organisation_owner_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_OWNER_ID) + @javax.annotation.Nonnull + private Long organisationOwnerId; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public OrganisationOwner() { + } + + public OrganisationOwner createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public OrganisationOwner organisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + return this; + } + + /** + * Get organisationId + * @return organisationId + */ + @javax.annotation.Nonnull + public Long getOrganisationId() { + return organisationId; + } + + public void setOrganisationId(@javax.annotation.Nonnull Long organisationId) { + this.organisationId = organisationId; + } + + + public OrganisationOwner organisationOwnerId(@javax.annotation.Nonnull Long organisationOwnerId) { + this.organisationOwnerId = organisationOwnerId; + return this; + } + + /** + * Get organisationOwnerId + * @return organisationOwnerId + */ + @javax.annotation.Nonnull + public Long getOrganisationOwnerId() { + return organisationOwnerId; + } + + public void setOrganisationOwnerId(@javax.annotation.Nonnull Long organisationOwnerId) { + this.organisationOwnerId = organisationOwnerId; + } + + + public OrganisationOwner userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganisationOwner instance itself + */ + public OrganisationOwner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganisationOwner organisationOwner = (OrganisationOwner) o; + return Objects.equals(this.createdAt, organisationOwner.createdAt) && + Objects.equals(this.organisationId, organisationOwner.organisationId) && + Objects.equals(this.organisationOwnerId, organisationOwner.organisationOwnerId) && + Objects.equals(this.userId, organisationOwner.userId)&& + Objects.equals(this.additionalProperties, organisationOwner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, organisationId, organisationOwnerId, userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganisationOwner {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" organisationId: ").append(toIndentedString(organisationId)).append("\n"); + sb.append(" organisationOwnerId: ").append(toIndentedString(organisationOwnerId)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("created_at", "organisation_id", "organisation_owner_id", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "organisation_id", "organisation_owner_id", "user_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 OrganisationOwner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganisationOwner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in OrganisationOwner is not found in the empty JSON string", OrganisationOwner.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganisationOwner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganisationOwner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganisationOwner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganisationOwner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganisationOwner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganisationOwner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganisationOwner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganisationOwner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganisationOwner + * @throws IOException if the JSON string is invalid with respect to OrganisationOwner + */ + public static OrganisationOwner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganisationOwner.class); + } + + /** + * Convert an instance of OrganisationOwner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/PasswordResetInputBody.java b/src/main/java/ai/reveng/model/PasswordResetInputBody.java new file mode 100644 index 0000000..21ac27d --- /dev/null +++ b/src/main/java/ai/reveng/model/PasswordResetInputBody.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * PasswordResetInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PasswordResetInputBody { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public PasswordResetInputBody() { + } + + public PasswordResetInputBody email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Email address of the account whose password should be reset + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordResetInputBody instance itself + */ + public PasswordResetInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordResetInputBody passwordResetInputBody = (PasswordResetInputBody) o; + return Objects.equals(this.email, passwordResetInputBody.email)&& + Objects.equals(this.additionalProperties, passwordResetInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordResetInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("email")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 PasswordResetInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordResetInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in PasswordResetInputBody is not found in the empty JSON string", PasswordResetInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordResetInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!PasswordResetInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordResetInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordResetInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasswordResetInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordResetInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordResetInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordResetInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordResetInputBody + * @throws IOException if the JSON string is invalid with respect to PasswordResetInputBody + */ + public static PasswordResetInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordResetInputBody.class); + } + + /** + * Convert an instance of PasswordResetInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/Permissions.java b/src/main/java/ai/reveng/model/Permissions.java new file mode 100644 index 0000000..4f96393 --- /dev/null +++ b/src/main/java/ai/reveng/model/Permissions.java @@ -0,0 +1,309 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * Permissions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Permissions { + public static final String SERIALIZED_NAME_CAN_EXPORT_SYMBOLS = "can_export_symbols"; + @SerializedName(SERIALIZED_NAME_CAN_EXPORT_SYMBOLS) + @javax.annotation.Nonnull + private Boolean canExportSymbols; + + public static final String SERIALIZED_NAME_CAN_GENERATE_PDF_REPORTS = "can_generate_pdf_reports"; + @SerializedName(SERIALIZED_NAME_CAN_GENERATE_PDF_REPORTS) + @javax.annotation.Nonnull + private Boolean canGeneratePdfReports; + + public static final String SERIALIZED_NAME_CAN_USE_AI_MALWARE_ANALYSIS = "can_use_ai_malware_analysis"; + @SerializedName(SERIALIZED_NAME_CAN_USE_AI_MALWARE_ANALYSIS) + @javax.annotation.Nonnull + private Boolean canUseAiMalwareAnalysis; + + public static final String SERIALIZED_NAME_CAN_USE_MALWARE_SANDBOX = "can_use_malware_sandbox"; + @SerializedName(SERIALIZED_NAME_CAN_USE_MALWARE_SANDBOX) + @javax.annotation.Nonnull + private Boolean canUseMalwareSandbox; + + public static final String SERIALIZED_NAME_CAN_USE_PRIVATE_ANALYSES = "can_use_private_analyses"; + @SerializedName(SERIALIZED_NAME_CAN_USE_PRIVATE_ANALYSES) + @javax.annotation.Nonnull + private Boolean canUsePrivateAnalyses; + + public Permissions() { + } + + public Permissions canExportSymbols(@javax.annotation.Nonnull Boolean canExportSymbols) { + this.canExportSymbols = canExportSymbols; + return this; + } + + /** + * Get canExportSymbols + * @return canExportSymbols + */ + @javax.annotation.Nonnull + public Boolean getCanExportSymbols() { + return canExportSymbols; + } + + public void setCanExportSymbols(@javax.annotation.Nonnull Boolean canExportSymbols) { + this.canExportSymbols = canExportSymbols; + } + + + public Permissions canGeneratePdfReports(@javax.annotation.Nonnull Boolean canGeneratePdfReports) { + this.canGeneratePdfReports = canGeneratePdfReports; + return this; + } + + /** + * Get canGeneratePdfReports + * @return canGeneratePdfReports + */ + @javax.annotation.Nonnull + public Boolean getCanGeneratePdfReports() { + return canGeneratePdfReports; + } + + public void setCanGeneratePdfReports(@javax.annotation.Nonnull Boolean canGeneratePdfReports) { + this.canGeneratePdfReports = canGeneratePdfReports; + } + + + public Permissions canUseAiMalwareAnalysis(@javax.annotation.Nonnull Boolean canUseAiMalwareAnalysis) { + this.canUseAiMalwareAnalysis = canUseAiMalwareAnalysis; + return this; + } + + /** + * Get canUseAiMalwareAnalysis + * @return canUseAiMalwareAnalysis + */ + @javax.annotation.Nonnull + public Boolean getCanUseAiMalwareAnalysis() { + return canUseAiMalwareAnalysis; + } + + public void setCanUseAiMalwareAnalysis(@javax.annotation.Nonnull Boolean canUseAiMalwareAnalysis) { + this.canUseAiMalwareAnalysis = canUseAiMalwareAnalysis; + } + + + public Permissions canUseMalwareSandbox(@javax.annotation.Nonnull Boolean canUseMalwareSandbox) { + this.canUseMalwareSandbox = canUseMalwareSandbox; + return this; + } + + /** + * Get canUseMalwareSandbox + * @return canUseMalwareSandbox + */ + @javax.annotation.Nonnull + public Boolean getCanUseMalwareSandbox() { + return canUseMalwareSandbox; + } + + public void setCanUseMalwareSandbox(@javax.annotation.Nonnull Boolean canUseMalwareSandbox) { + this.canUseMalwareSandbox = canUseMalwareSandbox; + } + + + public Permissions canUsePrivateAnalyses(@javax.annotation.Nonnull Boolean canUsePrivateAnalyses) { + this.canUsePrivateAnalyses = canUsePrivateAnalyses; + return this; + } + + /** + * Get canUsePrivateAnalyses + * @return canUsePrivateAnalyses + */ + @javax.annotation.Nonnull + public Boolean getCanUsePrivateAnalyses() { + return canUsePrivateAnalyses; + } + + public void setCanUsePrivateAnalyses(@javax.annotation.Nonnull Boolean canUsePrivateAnalyses) { + this.canUsePrivateAnalyses = canUsePrivateAnalyses; + } + + + + @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.canExportSymbols, permissions.canExportSymbols) && + Objects.equals(this.canGeneratePdfReports, permissions.canGeneratePdfReports) && + Objects.equals(this.canUseAiMalwareAnalysis, permissions.canUseAiMalwareAnalysis) && + Objects.equals(this.canUseMalwareSandbox, permissions.canUseMalwareSandbox) && + Objects.equals(this.canUsePrivateAnalyses, permissions.canUsePrivateAnalyses); + } + + @Override + public int hashCode() { + return Objects.hash(canExportSymbols, canGeneratePdfReports, canUseAiMalwareAnalysis, canUseMalwareSandbox, canUsePrivateAnalyses); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Permissions {\n"); + sb.append(" canExportSymbols: ").append(toIndentedString(canExportSymbols)).append("\n"); + sb.append(" canGeneratePdfReports: ").append(toIndentedString(canGeneratePdfReports)).append("\n"); + sb.append(" canUseAiMalwareAnalysis: ").append(toIndentedString(canUseAiMalwareAnalysis)).append("\n"); + sb.append(" canUseMalwareSandbox: ").append(toIndentedString(canUseMalwareSandbox)).append("\n"); + sb.append(" canUsePrivateAnalyses: ").append(toIndentedString(canUsePrivateAnalyses)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("can_export_symbols", "can_generate_pdf_reports", "can_use_ai_malware_analysis", "can_use_malware_sandbox", "can_use_private_analyses")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("can_export_symbols", "can_generate_pdf_reports", "can_use_ai_malware_analysis", "can_use_malware_sandbox", "can_use_private_analyses")); + } + + /** + * Validates the 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(java.util.Locale.ROOT, "The required field(s) %s in Permissions is not found in the empty JSON string", Permissions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Permissions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Permissions` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Permissions.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!Permissions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Permissions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Permissions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Permissions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Permissions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.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/ai/reveng/model/RefreshBody.java b/src/main/java/ai/reveng/model/RefreshBody.java new file mode 100644 index 0000000..c3e93a2 --- /dev/null +++ b/src/main/java/ai/reveng/model/RefreshBody.java @@ -0,0 +1,282 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * RefreshBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RefreshBody { + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public RefreshBody() { + } + + public RefreshBody refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * The refresh token to rotate (falls back to refresh_token cookie if omitted) + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RefreshBody instance itself + */ + public RefreshBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefreshBody refreshBody = (RefreshBody) o; + return Objects.equals(this.refreshToken, refreshBody.refreshToken)&& + Objects.equals(this.additionalProperties, refreshBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(refreshToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefreshBody {\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("refresh_token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RefreshBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RefreshBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RefreshBody is not found in the empty JSON string", RefreshBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!RefreshBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RefreshBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RefreshBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RefreshBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RefreshBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RefreshBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RefreshBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefreshBody + * @throws IOException if the JSON string is invalid with respect to RefreshBody + */ + public static RefreshBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RefreshBody.class); + } + + /** + * Convert an instance of RefreshBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RegisterUserInputBody.java b/src/main/java/ai/reveng/model/RegisterUserInputBody.java new file mode 100644 index 0000000..0e23480 --- /dev/null +++ b/src/main/java/ai/reveng/model/RegisterUserInputBody.java @@ -0,0 +1,434 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * RegisterUserInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RegisterUserInputBody { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_FIRST_NAME = "first_name"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nonnull + private String firstName; + + public static final String SERIALIZED_NAME_INVITE_CODE = "invite_code"; + @SerializedName(SERIALIZED_NAME_INVITE_CODE) + @javax.annotation.Nullable + private String inviteCode; + + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nonnull + private String lastName; + + 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 RegisterUserInputBody() { + } + + public RegisterUserInputBody email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Email address + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public RegisterUserInputBody firstName(@javax.annotation.Nonnull String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name + * @return firstName + */ + @javax.annotation.Nonnull + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nonnull String firstName) { + this.firstName = firstName; + } + + + public RegisterUserInputBody inviteCode(@javax.annotation.Nullable String inviteCode) { + this.inviteCode = inviteCode; + return this; + } + + /** + * Invite code from the registration email + * @return inviteCode + */ + @javax.annotation.Nullable + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(@javax.annotation.Nullable String inviteCode) { + this.inviteCode = inviteCode; + } + + + public RegisterUserInputBody lastName(@javax.annotation.Nonnull String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name + * @return lastName + */ + @javax.annotation.Nonnull + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nonnull String lastName) { + this.lastName = lastName; + } + + + public RegisterUserInputBody password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Password (minimum 10 characters) + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public RegisterUserInputBody username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RegisterUserInputBody instance itself + */ + public RegisterUserInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegisterUserInputBody registerUserInputBody = (RegisterUserInputBody) o; + return Objects.equals(this.email, registerUserInputBody.email) && + Objects.equals(this.firstName, registerUserInputBody.firstName) && + Objects.equals(this.inviteCode, registerUserInputBody.inviteCode) && + Objects.equals(this.lastName, registerUserInputBody.lastName) && + Objects.equals(this.password, registerUserInputBody.password) && + Objects.equals(this.username, registerUserInputBody.username)&& + Objects.equals(this.additionalProperties, registerUserInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, inviteCode, lastName, password, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegisterUserInputBody {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" inviteCode: ").append(toIndentedString(inviteCode)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("email", "first_name", "invite_code", "last_name", "password", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("email", "first_name", "last_name", "password", "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 RegisterUserInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RegisterUserInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RegisterUserInputBody is not found in the empty JSON string", RegisterUserInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RegisterUserInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("first_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); + } + if ((jsonObj.get("invite_code") != null && !jsonObj.get("invite_code").isJsonNull()) && !jsonObj.get("invite_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `invite_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invite_code").toString())); + } + if (!jsonObj.get("last_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_name").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!RegisterUserInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RegisterUserInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RegisterUserInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RegisterUserInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RegisterUserInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RegisterUserInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RegisterUserInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of RegisterUserInputBody + * @throws IOException if the JSON string is invalid with respect to RegisterUserInputBody + */ + public static RegisterUserInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RegisterUserInputBody.class); + } + + /** + * Convert an instance of RegisterUserInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/RevokeBody.java b/src/main/java/ai/reveng/model/RevokeBody.java new file mode 100644 index 0000000..9c76c56 --- /dev/null +++ b/src/main/java/ai/reveng/model/RevokeBody.java @@ -0,0 +1,282 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * RevokeBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RevokeBody { + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public RevokeBody() { + } + + public RevokeBody refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * The refresh token to revoke (falls back to refresh_token cookie if omitted) + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RevokeBody instance itself + */ + public RevokeBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeBody revokeBody = (RevokeBody) o; + return Objects.equals(this.refreshToken, revokeBody.refreshToken)&& + Objects.equals(this.additionalProperties, revokeBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(refreshToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RevokeBody {\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("refresh_token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RevokeBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RevokeBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RevokeBody is not found in the empty JSON string", RevokeBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!RevokeBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RevokeBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RevokeBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RevokeBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RevokeBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RevokeBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RevokeBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of RevokeBody + * @throws IOException if the JSON string is invalid with respect to RevokeBody + */ + public static RevokeBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RevokeBody.class); + } + + /** + * Convert an instance of RevokeBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SSOProvider.java b/src/main/java/ai/reveng/model/SSOProvider.java new file mode 100644 index 0000000..0247509 --- /dev/null +++ b/src/main/java/ai/reveng/model/SSOProvider.java @@ -0,0 +1,318 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * SSOProvider + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SSOProvider { + public static final String SERIALIZED_NAME_AUTH_URL = "auth_url"; + @SerializedName(SERIALIZED_NAME_AUTH_URL) + @javax.annotation.Nonnull + private String authUrl; + + public static final String SERIALIZED_NAME_ISSUER = "issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nonnull + private String issuer; + + public SSOProvider() { + } + + public SSOProvider authUrl(@javax.annotation.Nonnull String authUrl) { + this.authUrl = authUrl; + return this; + } + + /** + * Base authorization URL. Append code_challenge, code_challenge_method, redirect_uri, and state query parameters to complete the PKCE flow. + * @return authUrl + */ + @javax.annotation.Nonnull + public String getAuthUrl() { + return authUrl; + } + + public void setAuthUrl(@javax.annotation.Nonnull String authUrl) { + this.authUrl = authUrl; + } + + + public SSOProvider issuer(@javax.annotation.Nonnull String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Issuer URL of the identity provider. Pass this value as the issuer field in the SSO callback request. + * @return issuer + */ + @javax.annotation.Nonnull + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nonnull 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SSOProvider instance itself + */ + public SSOProvider putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SSOProvider ssOProvider = (SSOProvider) o; + return Objects.equals(this.authUrl, ssOProvider.authUrl) && + Objects.equals(this.issuer, ssOProvider.issuer)&& + Objects.equals(this.additionalProperties, ssOProvider.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(authUrl, issuer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SSOProvider {\n"); + sb.append(" authUrl: ").append(toIndentedString(authUrl)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("auth_url", "issuer")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("auth_url", "issuer")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SSOProvider + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SSOProvider.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SSOProvider is not found in the empty JSON string", SSOProvider.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SSOProvider.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("auth_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `auth_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auth_url").toString())); + } + if (!jsonObj.get("issuer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!SSOProvider.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SSOProvider' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SSOProvider.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SSOProvider value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SSOProvider read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SSOProvider instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SSOProvider given an JSON string + * + * @param jsonString JSON string + * @return An instance of SSOProvider + * @throws IOException if the JSON string is invalid with respect to SSOProvider + */ + public static SSOProvider fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SSOProvider.class); + } + + /** + * Convert an instance of SSOProvider to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/SSOProvidersOutputBody.java b/src/main/java/ai/reveng/model/SSOProvidersOutputBody.java new file mode 100644 index 0000000..8bebffd --- /dev/null +++ b/src/main/java/ai/reveng/model/SSOProvidersOutputBody.java @@ -0,0 +1,307 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.SSOProvider; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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 ai.reveng.invoker.JSON; + +/** + * SSOProvidersOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SSOProvidersOutputBody { + public static final String SERIALIZED_NAME_PROVIDERS = "providers"; + @SerializedName(SERIALIZED_NAME_PROVIDERS) + @javax.annotation.Nullable + private List providers; + + public SSOProvidersOutputBody() { + } + + public SSOProvidersOutputBody providers(@javax.annotation.Nullable List providers) { + this.providers = providers; + return this; + } + + public SSOProvidersOutputBody addProvidersItem(SSOProvider providersItem) { + if (this.providers == null) { + this.providers = new ArrayList<>(); + } + this.providers.add(providersItem); + return this; + } + + /** + * Get providers + * @return providers + */ + @javax.annotation.Nullable + public List getProviders() { + return providers; + } + + public void setProviders(@javax.annotation.Nullable List providers) { + this.providers = providers; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SSOProvidersOutputBody instance itself + */ + public SSOProvidersOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SSOProvidersOutputBody ssOProvidersOutputBody = (SSOProvidersOutputBody) o; + return Objects.equals(this.providers, ssOProvidersOutputBody.providers)&& + Objects.equals(this.additionalProperties, ssOProvidersOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(providers, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SSOProvidersOutputBody {\n"); + sb.append(" providers: ").append(toIndentedString(providers)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("providers")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("providers")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SSOProvidersOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SSOProvidersOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SSOProvidersOutputBody is not found in the empty JSON string", SSOProvidersOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SSOProvidersOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("providers") != null && !jsonObj.get("providers").isJsonNull()) { + if (!jsonObj.get("providers").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `providers` to be an array in the JSON string but got `%s`", jsonObj.get("providers").toString())); + } + JsonArray jsonArrayproviders = jsonObj.getAsJsonArray("providers"); + // validate the required field `providers` (array) + for (int i = 0; i < jsonArrayproviders.size(); i++) { + SSOProvider.validateJsonElement(jsonArrayproviders.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SSOProvidersOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SSOProvidersOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SSOProvidersOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SSOProvidersOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SSOProvidersOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SSOProvidersOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SSOProvidersOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of SSOProvidersOutputBody + * @throws IOException if the JSON string is invalid with respect to SSOProvidersOutputBody + */ + public static SSOProvidersOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SSOProvidersOutputBody.class); + } + + /** + * Convert an instance of SSOProvidersOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/Team.java b/src/main/java/ai/reveng/model/Team.java new file mode 100644 index 0000000..96ca79e --- /dev/null +++ b/src/main/java/ai/reveng/model/Team.java @@ -0,0 +1,349 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * Team + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Team { + public static final String SERIALIZED_NAME_ORGANISATION_ID = "organisation_id"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_ID) + @javax.annotation.Nullable + private Long organisationId; + + /** + * Gets or Sets plan + */ + @JsonAdapter(PlanEnum.Adapter.class) + public enum PlanEnum { + FREE("Free"), + + INDIVIDUAL("Individual"), + + TESTER("Tester"), + + ORGANISATION("Organisation"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PlanEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PlanEnum fromValue(String value) { + for (PlanEnum b : PlanEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PlanEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PlanEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PlanEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PlanEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PLAN = "plan"; + @SerializedName(SERIALIZED_NAME_PLAN) + @javax.annotation.Nonnull + private PlanEnum plan; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_TEAM_NAME = "team_name"; + @SerializedName(SERIALIZED_NAME_TEAM_NAME) + @javax.annotation.Nonnull + private String teamName; + + public Team() { + } + + public Team organisationId(@javax.annotation.Nullable Long organisationId) { + this.organisationId = organisationId; + return this; + } + + /** + * Organisation this team belongs to, if any + * @return organisationId + */ + @javax.annotation.Nullable + public Long getOrganisationId() { + return organisationId; + } + + public void setOrganisationId(@javax.annotation.Nullable Long organisationId) { + this.organisationId = organisationId; + } + + + public Team plan(@javax.annotation.Nonnull PlanEnum plan) { + this.plan = plan; + return this; + } + + /** + * Get plan + * @return plan + */ + @javax.annotation.Nonnull + public PlanEnum getPlan() { + return plan; + } + + public void setPlan(@javax.annotation.Nonnull PlanEnum plan) { + this.plan = plan; + } + + + public Team teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Get teamId + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public Team teamName(@javax.annotation.Nonnull String teamName) { + this.teamName = teamName; + return this; + } + + /** + * Get teamName + * @return teamName + */ + @javax.annotation.Nonnull + public String getTeamName() { + return teamName; + } + + public void setTeamName(@javax.annotation.Nonnull String teamName) { + this.teamName = teamName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Team team = (Team) o; + return Objects.equals(this.organisationId, team.organisationId) && + Objects.equals(this.plan, team.plan) && + Objects.equals(this.teamId, team.teamId) && + Objects.equals(this.teamName, team.teamName); + } + + @Override + public int hashCode() { + return Objects.hash(organisationId, plan, teamId, teamName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Team {\n"); + sb.append(" organisationId: ").append(toIndentedString(organisationId)).append("\n"); + sb.append(" plan: ").append(toIndentedString(plan)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" teamName: ").append(toIndentedString(teamName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("organisation_id", "plan", "team_id", "team_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("plan", "team_id", "team_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 Team + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Team.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Team is not found in the empty JSON string", Team.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Team.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Team` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Team.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("plan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `plan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan").toString())); + } + // validate the required field `plan` + PlanEnum.validateJsonElement(jsonObj.get("plan")); + if (!jsonObj.get("team_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `team_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("team_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Team.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Team' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Team.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Team value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Team read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Team given an JSON string + * + * @param jsonString JSON string + * @return An instance of Team + * @throws IOException if the JSON string is invalid with respect to Team + */ + public static Team fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Team.class); + } + + /** + * Convert an instance of Team to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TeamMember.java b/src/main/java/ai/reveng/model/TeamMember.java new file mode 100644 index 0000000..a103cf2 --- /dev/null +++ b/src/main/java/ai/reveng/model/TeamMember.java @@ -0,0 +1,459 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * TeamMember + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamMember { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_IS_ADMIN = "is_admin"; + @SerializedName(SERIALIZED_NAME_IS_ADMIN) + @javax.annotation.Nonnull + private Boolean isAdmin; + + /** + * Gets or Sets role + */ + @JsonAdapter(RoleEnum.Adapter.class) + public enum RoleEnum { + USER("USER"), + + ADMIN("ADMIN"), + + SUPERADMIN("SUPERADMIN"), + + SYSTEM("SYSTEM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RoleEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RoleEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RoleEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RoleEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private RoleEnum role; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public TeamMember() { + } + + public TeamMember email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Search is applied to string value + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public TeamMember isAdmin(@javax.annotation.Nonnull Boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get isAdmin + * @return isAdmin + */ + @javax.annotation.Nonnull + public Boolean getIsAdmin() { + return isAdmin; + } + + public void setIsAdmin(@javax.annotation.Nonnull Boolean isAdmin) { + this.isAdmin = isAdmin; + } + + + public TeamMember role(@javax.annotation.Nonnull RoleEnum role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public RoleEnum getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull RoleEnum role) { + this.role = role; + } + + + public TeamMember userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + + + public TeamMember username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Search is applied to string value + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TeamMember instance itself + */ + public TeamMember putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamMember teamMember = (TeamMember) o; + return Objects.equals(this.email, teamMember.email) && + Objects.equals(this.isAdmin, teamMember.isAdmin) && + Objects.equals(this.role, teamMember.role) && + Objects.equals(this.userId, teamMember.userId) && + Objects.equals(this.username, teamMember.username)&& + Objects.equals(this.additionalProperties, teamMember.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, isAdmin, role, userId, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamMember {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" isAdmin: ").append(toIndentedString(isAdmin)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("email", "is_admin", "role", "user_id", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("email", "is_admin", "role", "user_id", "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 TeamMember + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamMember.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TeamMember is not found in the empty JSON string", TeamMember.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamMember.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role").toString())); + } + // validate the required field `role` + RoleEnum.validateJsonElement(jsonObj.get("role")); + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamMember.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamMember' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamMember.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamMember value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TeamMember read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TeamMember instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamMember given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamMember + * @throws IOException if the JSON string is invalid with respect to TeamMember + */ + public static TeamMember fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamMember.class); + } + + /** + * Convert an instance of TeamMember to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TokenInputBody.java b/src/main/java/ai/reveng/model/TokenInputBody.java new file mode 100644 index 0000000..2016f1b --- /dev/null +++ b/src/main/java/ai/reveng/model/TokenInputBody.java @@ -0,0 +1,369 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * TokenInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TokenInputBody { + public static final String SERIALIZED_NAME_API_KEY = "api_key"; + @SerializedName(SERIALIZED_NAME_API_KEY) + @javax.annotation.Nullable + private String apiKey; + + 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 static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public TokenInputBody() { + } + + public TokenInputBody apiKey(@javax.annotation.Nullable String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * API key to exchange for a JWT + * @return apiKey + */ + @javax.annotation.Nullable + public String getApiKey() { + return apiKey; + } + + public void setApiKey(@javax.annotation.Nullable String apiKey) { + this.apiKey = apiKey; + } + + + public TokenInputBody email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * User email address (required with password) + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public TokenInputBody password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * User password (required with email or username) + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public TokenInputBody username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Username (alternative to email, required with password) + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TokenInputBody instance itself + */ + public TokenInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TokenInputBody tokenInputBody = (TokenInputBody) o; + return Objects.equals(this.apiKey, tokenInputBody.apiKey) && + Objects.equals(this.email, tokenInputBody.email) && + Objects.equals(this.password, tokenInputBody.password) && + Objects.equals(this.username, tokenInputBody.username)&& + Objects.equals(this.additionalProperties, tokenInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(apiKey, email, password, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TokenInputBody {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("api_key", "email", "password", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TokenInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TokenInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TokenInputBody is not found in the empty JSON string", TokenInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("api_key") != null && !jsonObj.get("api_key").isJsonNull()) && !jsonObj.get("api_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `api_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("api_key").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!TokenInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TokenInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TokenInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TokenInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TokenInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TokenInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TokenInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of TokenInputBody + * @throws IOException if the JSON string is invalid with respect to TokenInputBody + */ + public static TokenInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TokenInputBody.class); + } + + /** + * Convert an instance of TokenInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/TokenResponse.java b/src/main/java/ai/reveng/model/TokenResponse.java new file mode 100644 index 0000000..347c354 --- /dev/null +++ b/src/main/java/ai/reveng/model/TokenResponse.java @@ -0,0 +1,373 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * TokenResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TokenResponse { + 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_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nonnull + private Long expiresIn; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nonnull + private String refreshToken; + + public static final String SERIALIZED_NAME_TOKEN_TYPE = "token_type"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + @javax.annotation.Nonnull + private String tokenType; + + public TokenResponse() { + } + + public TokenResponse accessToken(@javax.annotation.Nonnull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Signed JWT access token + * @return accessToken + */ + @javax.annotation.Nonnull + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nonnull String accessToken) { + this.accessToken = accessToken; + } + + + public TokenResponse expiresIn(@javax.annotation.Nonnull Long expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Access token lifetime in seconds + * @return expiresIn + */ + @javax.annotation.Nonnull + public Long getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nonnull Long expiresIn) { + this.expiresIn = expiresIn; + } + + + public TokenResponse refreshToken(@javax.annotation.Nonnull String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Opaque refresh token for obtaining new access tokens + * @return refreshToken + */ + @javax.annotation.Nonnull + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nonnull String refreshToken) { + this.refreshToken = refreshToken; + } + + + public TokenResponse tokenType(@javax.annotation.Nonnull String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Token type (always Bearer) + * @return tokenType + */ + @javax.annotation.Nonnull + public String getTokenType() { + return tokenType; + } + + public void setTokenType(@javax.annotation.Nonnull 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TokenResponse instance itself + */ + public TokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TokenResponse tokenResponse = (TokenResponse) o; + return Objects.equals(this.accessToken, tokenResponse.accessToken) && + Objects.equals(this.expiresIn, tokenResponse.expiresIn) && + Objects.equals(this.refreshToken, tokenResponse.refreshToken) && + Objects.equals(this.tokenType, tokenResponse.tokenType)&& + Objects.equals(this.additionalProperties, tokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expiresIn, refreshToken, tokenType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TokenResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("access_token", "expires_in", "refresh_token", "token_type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("access_token", "expires_in", "refresh_token", "token_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 TokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TokenResponse is not found in the empty JSON string", TokenResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TokenResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!TokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TokenResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TokenResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TokenResponse + * @throws IOException if the JSON string is invalid with respect to TokenResponse + */ + public static TokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TokenResponse.class); + } + + /** + * Convert an instance of TokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdateIssuerInputBody.java b/src/main/java/ai/reveng/model/UpdateIssuerInputBody.java new file mode 100644 index 0000000..a664cdc --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateIssuerInputBody.java @@ -0,0 +1,286 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdateIssuerInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateIssuerInputBody { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nonnull + private Boolean enabled; + + public UpdateIssuerInputBody() { + } + + public UpdateIssuerInputBody enabled(@javax.annotation.Nonnull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the issuer is enabled + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nonnull 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateIssuerInputBody instance itself + */ + public UpdateIssuerInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateIssuerInputBody updateIssuerInputBody = (UpdateIssuerInputBody) o; + return Objects.equals(this.enabled, updateIssuerInputBody.enabled)&& + Objects.equals(this.additionalProperties, updateIssuerInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateIssuerInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("enabled")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("enabled")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateIssuerInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateIssuerInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateIssuerInputBody is not found in the empty JSON string", UpdateIssuerInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateIssuerInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateIssuerInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateIssuerInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateIssuerInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateIssuerInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateIssuerInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateIssuerInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateIssuerInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateIssuerInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateIssuerInputBody + */ + public static UpdateIssuerInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateIssuerInputBody.class); + } + + /** + * Convert an instance of UpdateIssuerInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdateOrganisationInputBody.java b/src/main/java/ai/reveng/model/UpdateOrganisationInputBody.java new file mode 100644 index 0000000..1d7f16a --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateOrganisationInputBody.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdateOrganisationInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateOrganisationInputBody { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public UpdateOrganisationInputBody() { + } + + public UpdateOrganisationInputBody name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * New organisation name + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateOrganisationInputBody instance itself + */ + public UpdateOrganisationInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganisationInputBody updateOrganisationInputBody = (UpdateOrganisationInputBody) o; + return Objects.equals(this.name, updateOrganisationInputBody.name)&& + Objects.equals(this.additionalProperties, updateOrganisationInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateOrganisationInputBody {\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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 UpdateOrganisationInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateOrganisationInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateOrganisationInputBody is not found in the empty JSON string", UpdateOrganisationInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateOrganisationInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateOrganisationInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateOrganisationInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateOrganisationInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateOrganisationInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateOrganisationInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateOrganisationInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateOrganisationInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateOrganisationInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateOrganisationInputBody + */ + public static UpdateOrganisationInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateOrganisationInputBody.class); + } + + /** + * Convert an instance of UpdateOrganisationInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdatePasswordInputBody.java b/src/main/java/ai/reveng/model/UpdatePasswordInputBody.java new file mode 100644 index 0000000..7fdc305 --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdatePasswordInputBody.java @@ -0,0 +1,318 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdatePasswordInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdatePasswordInputBody { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private String code; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public UpdatePasswordInputBody() { + } + + public UpdatePasswordInputBody code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * Password reset code received by email + * @return code + */ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + + public UpdatePasswordInputBody password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * New password (minimum 10 characters) + * @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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdatePasswordInputBody instance itself + */ + public UpdatePasswordInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePasswordInputBody updatePasswordInputBody = (UpdatePasswordInputBody) o; + return Objects.equals(this.code, updatePasswordInputBody.code) && + Objects.equals(this.password, updatePasswordInputBody.password)&& + Objects.equals(this.additionalProperties, updatePasswordInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, password, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePasswordInputBody {\n"); + sb.append(" code: ").append(toIndentedString(code)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("code", "password")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("code", "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 UpdatePasswordInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePasswordInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdatePasswordInputBody is not found in the empty JSON string", UpdatePasswordInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdatePasswordInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePasswordInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePasswordInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePasswordInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePasswordInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdatePasswordInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePasswordInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePasswordInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePasswordInputBody + * @throws IOException if the JSON string is invalid with respect to UpdatePasswordInputBody + */ + public static UpdatePasswordInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePasswordInputBody.class); + } + + /** + * Convert an instance of UpdatePasswordInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdateProfileInputBody.java b/src/main/java/ai/reveng/model/UpdateProfileInputBody.java new file mode 100644 index 0000000..a91c832 --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateProfileInputBody.java @@ -0,0 +1,396 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdateProfileInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateProfileInputBody { + public static final String SERIALIZED_NAME_DEFAULT_TEAM_ID = "default_team_id"; + @SerializedName(SERIALIZED_NAME_DEFAULT_TEAM_ID) + @javax.annotation.Nullable + private Long defaultTeamId; + + public static final String SERIALIZED_NAME_FIRST_NAME = "first_name"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public UpdateProfileInputBody() { + } + + public UpdateProfileInputBody defaultTeamId(@javax.annotation.Nullable Long defaultTeamId) { + this.defaultTeamId = defaultTeamId; + return this; + } + + /** + * Default team ID + * minimum: 1 + * @return defaultTeamId + */ + @javax.annotation.Nullable + public Long getDefaultTeamId() { + return defaultTeamId; + } + + public void setDefaultTeamId(@javax.annotation.Nullable Long defaultTeamId) { + this.defaultTeamId = defaultTeamId; + } + + + public UpdateProfileInputBody firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public UpdateProfileInputBody lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public UpdateProfileInputBody timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * IANA time zone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public UpdateProfileInputBody 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; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateProfileInputBody instance itself + */ + public UpdateProfileInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateProfileInputBody updateProfileInputBody = (UpdateProfileInputBody) o; + return Objects.equals(this.defaultTeamId, updateProfileInputBody.defaultTeamId) && + Objects.equals(this.firstName, updateProfileInputBody.firstName) && + Objects.equals(this.lastName, updateProfileInputBody.lastName) && + Objects.equals(this.timeZone, updateProfileInputBody.timeZone) && + Objects.equals(this.username, updateProfileInputBody.username)&& + Objects.equals(this.additionalProperties, updateProfileInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(defaultTeamId, firstName, lastName, timeZone, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateProfileInputBody {\n"); + sb.append(" defaultTeamId: ").append(toIndentedString(defaultTeamId)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("default_team_id", "first_name", "last_name", "time_zone", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateProfileInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateProfileInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateProfileInputBody is not found in the empty JSON string", UpdateProfileInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("first_name") != null && !jsonObj.get("first_name").isJsonNull()) && !jsonObj.get("first_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); + } + if ((jsonObj.get("last_name") != null && !jsonObj.get("last_name").isJsonNull()) && !jsonObj.get("last_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_name").toString())); + } + if ((jsonObj.get("time_zone") != null && !jsonObj.get("time_zone").isJsonNull()) && !jsonObj.get("time_zone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `time_zone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_zone").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateProfileInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateProfileInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateProfileInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateProfileInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateProfileInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateProfileInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateProfileInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateProfileInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateProfileInputBody + */ + public static UpdateProfileInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateProfileInputBody.class); + } + + /** + * Convert an instance of UpdateProfileInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdateTeamInputBody.java b/src/main/java/ai/reveng/model/UpdateTeamInputBody.java new file mode 100644 index 0000000..3f3b0be --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateTeamInputBody.java @@ -0,0 +1,282 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdateTeamInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateTeamInputBody { + public static final String SERIALIZED_NAME_TEAM_NAME = "team_name"; + @SerializedName(SERIALIZED_NAME_TEAM_NAME) + @javax.annotation.Nullable + private String teamName; + + public UpdateTeamInputBody() { + } + + public UpdateTeamInputBody teamName(@javax.annotation.Nullable String teamName) { + this.teamName = teamName; + return this; + } + + /** + * Team name + * @return teamName + */ + @javax.annotation.Nullable + public String getTeamName() { + return teamName; + } + + public void setTeamName(@javax.annotation.Nullable String teamName) { + this.teamName = teamName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateTeamInputBody instance itself + */ + public UpdateTeamInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTeamInputBody updateTeamInputBody = (UpdateTeamInputBody) o; + return Objects.equals(this.teamName, updateTeamInputBody.teamName)&& + Objects.equals(this.additionalProperties, updateTeamInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(teamName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTeamInputBody {\n"); + sb.append(" teamName: ").append(toIndentedString(teamName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("team_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateTeamInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateTeamInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateTeamInputBody is not found in the empty JSON string", UpdateTeamInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("team_name") != null && !jsonObj.get("team_name").isJsonNull()) && !jsonObj.get("team_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `team_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("team_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTeamInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTeamInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateTeamInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTeamInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateTeamInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateTeamInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTeamInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTeamInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateTeamInputBody + */ + public static UpdateTeamInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTeamInputBody.class); + } + + /** + * Convert an instance of UpdateTeamInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdateUserCreditsInputBody.java b/src/main/java/ai/reveng/model/UpdateUserCreditsInputBody.java new file mode 100644 index 0000000..20ac786 --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateUserCreditsInputBody.java @@ -0,0 +1,287 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdateUserCreditsInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateUserCreditsInputBody { + public static final String SERIALIZED_NAME_CREDITS = "credits"; + @SerializedName(SERIALIZED_NAME_CREDITS) + @javax.annotation.Nonnull + private Long credits; + + public UpdateUserCreditsInputBody() { + } + + public UpdateUserCreditsInputBody credits(@javax.annotation.Nonnull Long credits) { + this.credits = credits; + return this; + } + + /** + * Credit balance to set + * minimum: 0 + * @return credits + */ + @javax.annotation.Nonnull + public Long getCredits() { + return credits; + } + + public void setCredits(@javax.annotation.Nonnull Long credits) { + this.credits = credits; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateUserCreditsInputBody instance itself + */ + public UpdateUserCreditsInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserCreditsInputBody updateUserCreditsInputBody = (UpdateUserCreditsInputBody) o; + return Objects.equals(this.credits, updateUserCreditsInputBody.credits)&& + Objects.equals(this.additionalProperties, updateUserCreditsInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credits, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserCreditsInputBody {\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("credits")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("credits")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateUserCreditsInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateUserCreditsInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateUserCreditsInputBody is not found in the empty JSON string", UpdateUserCreditsInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateUserCreditsInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateUserCreditsInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateUserCreditsInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateUserCreditsInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateUserCreditsInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateUserCreditsInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateUserCreditsInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateUserCreditsInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateUserCreditsInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateUserCreditsInputBody + */ + public static UpdateUserCreditsInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateUserCreditsInputBody.class); + } + + /** + * Convert an instance of UpdateUserCreditsInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdateUserInputBody.java b/src/main/java/ai/reveng/model/UpdateUserInputBody.java new file mode 100644 index 0000000..fbcfbf3 --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateUserInputBody.java @@ -0,0 +1,580 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdateUserInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateUserInputBody { + 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 = "first_name"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + /** + * User role (SUPERADMIN only) + */ + @JsonAdapter(RoleEnum.Adapter.class) + public enum RoleEnum { + USER("USER"), + + ADMIN("ADMIN"), + + SUPERADMIN("SUPERADMIN"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RoleEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RoleEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RoleEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RoleEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private RoleEnum role; + + /** + * User tier (SUPERADMIN only) + */ + @JsonAdapter(TierEnum.Adapter.class) + public enum TierEnum { + ENTHUSIAST("ENTHUSIAST"), + + REVERSER("REVERSER"), + + BUG_HUNTER("BUG_HUNTER"), + + MALWARE_ANALYST("MALWARE_ANALYST"), + + SECURITY_RESEARCHER("SECURITY_RESEARCHER"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TierEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TierEnum fromValue(String value) { + for (TierEnum b : TierEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TierEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TierEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TierEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TierEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + @javax.annotation.Nullable + private TierEnum tier; + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public UpdateUserInputBody() { + } + + public UpdateUserInputBody email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public UpdateUserInputBody firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public UpdateUserInputBody lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public UpdateUserInputBody role(@javax.annotation.Nullable RoleEnum role) { + this.role = role; + return this; + } + + /** + * User role (SUPERADMIN only) + * @return role + */ + @javax.annotation.Nullable + public RoleEnum getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable RoleEnum role) { + this.role = role; + } + + + public UpdateUserInputBody tier(@javax.annotation.Nullable TierEnum tier) { + this.tier = tier; + return this; + } + + /** + * User tier (SUPERADMIN only) + * @return tier + */ + @javax.annotation.Nullable + public TierEnum getTier() { + return tier; + } + + public void setTier(@javax.annotation.Nullable TierEnum tier) { + this.tier = tier; + } + + + public UpdateUserInputBody timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * IANA time zone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public UpdateUserInputBody 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; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateUserInputBody instance itself + */ + public UpdateUserInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserInputBody updateUserInputBody = (UpdateUserInputBody) o; + return Objects.equals(this.email, updateUserInputBody.email) && + Objects.equals(this.firstName, updateUserInputBody.firstName) && + Objects.equals(this.lastName, updateUserInputBody.lastName) && + Objects.equals(this.role, updateUserInputBody.role) && + Objects.equals(this.tier, updateUserInputBody.tier) && + Objects.equals(this.timeZone, updateUserInputBody.timeZone) && + Objects.equals(this.username, updateUserInputBody.username)&& + Objects.equals(this.additionalProperties, updateUserInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, role, tier, timeZone, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserInputBody {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("email", "first_name", "last_name", "role", "tier", "time_zone", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateUserInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateUserInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateUserInputBody is not found in the empty JSON string", UpdateUserInputBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("first_name") != null && !jsonObj.get("first_name").isJsonNull()) && !jsonObj.get("first_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); + } + if ((jsonObj.get("last_name") != null && !jsonObj.get("last_name").isJsonNull()) && !jsonObj.get("last_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_name").toString())); + } + if ((jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) && !jsonObj.get("role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role").toString())); + } + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + RoleEnum.validateJsonElement(jsonObj.get("role")); + } + if ((jsonObj.get("tier") != null && !jsonObj.get("tier").isJsonNull()) && !jsonObj.get("tier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tier").toString())); + } + // validate the optional field `tier` + if (jsonObj.get("tier") != null && !jsonObj.get("tier").isJsonNull()) { + TierEnum.validateJsonElement(jsonObj.get("tier")); + } + if ((jsonObj.get("time_zone") != null && !jsonObj.get("time_zone").isJsonNull()) && !jsonObj.get("time_zone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `time_zone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_zone").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateUserInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateUserInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateUserInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateUserInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateUserInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateUserInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateUserInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateUserInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateUserInputBody + */ + public static UpdateUserInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateUserInputBody.class); + } + + /** + * Convert an instance of UpdateUserInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UpdateUserPasswordInputBody.java b/src/main/java/ai/reveng/model/UpdateUserPasswordInputBody.java new file mode 100644 index 0000000..773ce97 --- /dev/null +++ b/src/main/java/ai/reveng/model/UpdateUserPasswordInputBody.java @@ -0,0 +1,318 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UpdateUserPasswordInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateUserPasswordInputBody { + public static final String SERIALIZED_NAME_CURRENT_PASSWORD = "current_password"; + @SerializedName(SERIALIZED_NAME_CURRENT_PASSWORD) + @javax.annotation.Nullable + private String currentPassword; + + public static final String SERIALIZED_NAME_NEW_PASSWORD = "new_password"; + @SerializedName(SERIALIZED_NAME_NEW_PASSWORD) + @javax.annotation.Nonnull + private String newPassword; + + public UpdateUserPasswordInputBody() { + } + + public UpdateUserPasswordInputBody currentPassword(@javax.annotation.Nullable String currentPassword) { + this.currentPassword = currentPassword; + return this; + } + + /** + * Current password (required when changing your own password; ignored for SUPERADMIN updates of other users) + * @return currentPassword + */ + @javax.annotation.Nullable + public String getCurrentPassword() { + return currentPassword; + } + + public void setCurrentPassword(@javax.annotation.Nullable String currentPassword) { + this.currentPassword = currentPassword; + } + + + public UpdateUserPasswordInputBody newPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + return this; + } + + /** + * New password (minimum 10 characters) + * @return newPassword + */ + @javax.annotation.Nonnull + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateUserPasswordInputBody instance itself + */ + public UpdateUserPasswordInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserPasswordInputBody updateUserPasswordInputBody = (UpdateUserPasswordInputBody) o; + return Objects.equals(this.currentPassword, updateUserPasswordInputBody.currentPassword) && + Objects.equals(this.newPassword, updateUserPasswordInputBody.newPassword)&& + Objects.equals(this.additionalProperties, updateUserPasswordInputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(currentPassword, newPassword, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserPasswordInputBody {\n"); + sb.append(" currentPassword: ").append(toIndentedString(currentPassword)).append("\n"); + sb.append(" newPassword: ").append(toIndentedString(newPassword)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("current_password", "new_password")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("new_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 UpdateUserPasswordInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateUserPasswordInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateUserPasswordInputBody is not found in the empty JSON string", UpdateUserPasswordInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateUserPasswordInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("current_password") != null && !jsonObj.get("current_password").isJsonNull()) && !jsonObj.get("current_password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `current_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("current_password").toString())); + } + if (!jsonObj.get("new_password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `new_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateUserPasswordInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateUserPasswordInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateUserPasswordInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateUserPasswordInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateUserPasswordInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateUserPasswordInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateUserPasswordInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateUserPasswordInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateUserPasswordInputBody + */ + public static UpdateUserPasswordInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateUserPasswordInputBody.class); + } + + /** + * Convert an instance of UpdateUserPasswordInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/User.java b/src/main/java/ai/reveng/model/User.java new file mode 100644 index 0000000..ac422f2 --- /dev/null +++ b/src/main/java/ai/reveng/model/User.java @@ -0,0 +1,472 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.UserProfile; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * User + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class User { + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_PROFILE = "profile"; + @SerializedName(SERIALIZED_NAME_PROFILE) + @javax.annotation.Nonnull + private UserProfile profile; + + /** + * Gets or Sets role + */ + @JsonAdapter(RoleEnum.Adapter.class) + public enum RoleEnum { + USER("USER"), + + ADMIN("ADMIN"), + + SUPERADMIN("SUPERADMIN"), + + SYSTEM("SYSTEM"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RoleEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RoleEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RoleEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RoleEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private RoleEnum role; + + /** + * Gets or Sets tier + */ + @JsonAdapter(TierEnum.Adapter.class) + public enum TierEnum { + ENTHUSIAST("ENTHUSIAST"), + + REVERSER("REVERSER"), + + BUG_HUNTER("BUG_HUNTER"), + + MALWARE_ANALYST("MALWARE_ANALYST"), + + SECURITY_RESEARCHER("SECURITY_RESEARCHER"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TierEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TierEnum fromValue(String value) { + for (TierEnum b : TierEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TierEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TierEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TierEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TierEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + @javax.annotation.Nullable + private TierEnum tier; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public User() { + } + + public User 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; + } + + + public User 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 User profile(@javax.annotation.Nonnull UserProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get profile + * @return profile + */ + @javax.annotation.Nonnull + public UserProfile getProfile() { + return profile; + } + + public void setProfile(@javax.annotation.Nonnull UserProfile profile) { + this.profile = profile; + } + + + public User role(@javax.annotation.Nonnull RoleEnum role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public RoleEnum getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull RoleEnum role) { + this.role = role; + } + + + public User tier(@javax.annotation.Nullable TierEnum tier) { + this.tier = tier; + return this; + } + + /** + * Get tier + * @return tier + */ + @javax.annotation.Nullable + public TierEnum getTier() { + return tier; + } + + public void setTier(@javax.annotation.Nullable TierEnum tier) { + this.tier = tier; + } + + + public User userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.createdAt, user.createdAt) && + Objects.equals(this.email, user.email) && + Objects.equals(this.profile, user.profile) && + Objects.equals(this.role, user.role) && + Objects.equals(this.tier, user.tier) && + Objects.equals(this.userId, user.userId); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, email, profile, role, tier, userId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("created_at", "email", "profile", "role", "tier", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("email", "profile", "role", "user_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 User + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : User.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the required field `profile` + UserProfile.validateJsonElement(jsonObj.get("profile")); + if (!jsonObj.get("role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role").toString())); + } + // validate the required field `role` + RoleEnum.validateJsonElement(jsonObj.get("role")); + if ((jsonObj.get("tier") != null && !jsonObj.get("tier").isJsonNull()) && !jsonObj.get("tier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tier").toString())); + } + // validate the optional field `tier` + if (jsonObj.get("tier") != null && !jsonObj.get("tier").isJsonNull()) { + TierEnum.validateJsonElement(jsonObj.get("tier")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UserCredits.java b/src/main/java/ai/reveng/model/UserCredits.java new file mode 100644 index 0000000..2398445 --- /dev/null +++ b/src/main/java/ai/reveng/model/UserCredits.java @@ -0,0 +1,365 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * UserCredits + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserCredits { + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_CREDITS = "credits"; + @SerializedName(SERIALIZED_NAME_CREDITS) + @javax.annotation.Nonnull + private Long credits; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public UserCredits() { + } + + public UserCredits 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; + } + + + public UserCredits credits(@javax.annotation.Nonnull Long credits) { + this.credits = credits; + return this; + } + + /** + * Get credits + * @return credits + */ + @javax.annotation.Nonnull + public Long getCredits() { + return credits; + } + + public void setCredits(@javax.annotation.Nonnull Long credits) { + this.credits = credits; + } + + + public UserCredits updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public UserCredits userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long 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 additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserCredits instance itself + */ + public UserCredits putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCredits userCredits = (UserCredits) o; + return Objects.equals(this.createdAt, userCredits.createdAt) && + Objects.equals(this.credits, userCredits.credits) && + Objects.equals(this.updatedAt, userCredits.updatedAt) && + Objects.equals(this.userId, userCredits.userId)&& + Objects.equals(this.additionalProperties, userCredits.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, credits, updatedAt, userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCredits {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("created_at", "credits", "updated_at", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("credits", "user_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 UserCredits + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCredits.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UserCredits is not found in the empty JSON string", UserCredits.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCredits.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCredits.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCredits' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCredits.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCredits value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserCredits read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserCredits instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCredits given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCredits + * @throws IOException if the JSON string is invalid with respect to UserCredits + */ + public static UserCredits fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCredits.class); + } + + /** + * Convert an instance of UserCredits to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UserIdentity.java b/src/main/java/ai/reveng/model/UserIdentity.java new file mode 100644 index 0000000..40e1bc9 --- /dev/null +++ b/src/main/java/ai/reveng/model/UserIdentity.java @@ -0,0 +1,423 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +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 ai.reveng.invoker.JSON; + +/** + * UserIdentity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserIdentity { + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ISSUER_URL = "issuer_url"; + @SerializedName(SERIALIZED_NAME_ISSUER_URL) + @javax.annotation.Nullable + private String issuerUrl; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nullable + private String subject; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public static final String SERIALIZED_NAME_USER_IDENTITY_ID = "user_identity_id"; + @SerializedName(SERIALIZED_NAME_USER_IDENTITY_ID) + @javax.annotation.Nonnull + private Long userIdentityId; + + public UserIdentity() { + } + + public UserIdentity createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public UserIdentity issuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * Search is applied to string value + * @return issuerUrl + */ + @javax.annotation.Nullable + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + + public UserIdentity subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * Search is applied to string value + * @return subject + */ + @javax.annotation.Nullable + public String getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public UserIdentity updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public UserIdentity userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + + + public UserIdentity userIdentityId(@javax.annotation.Nonnull Long userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + /** + * Get userIdentityId + * @return userIdentityId + */ + @javax.annotation.Nonnull + public Long getUserIdentityId() { + return userIdentityId; + } + + public void setUserIdentityId(@javax.annotation.Nonnull Long userIdentityId) { + this.userIdentityId = userIdentityId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserIdentity instance itself + */ + public UserIdentity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserIdentity userIdentity = (UserIdentity) o; + return Objects.equals(this.createdAt, userIdentity.createdAt) && + Objects.equals(this.issuerUrl, userIdentity.issuerUrl) && + Objects.equals(this.subject, userIdentity.subject) && + Objects.equals(this.updatedAt, userIdentity.updatedAt) && + Objects.equals(this.userId, userIdentity.userId) && + Objects.equals(this.userIdentityId, userIdentity.userIdentityId)&& + Objects.equals(this.additionalProperties, userIdentity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, issuerUrl, subject, updatedAt, userId, userIdentityId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserIdentity {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userIdentityId: ").append(toIndentedString(userIdentityId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("created_at", "issuer_url", "subject", "updated_at", "user_id", "user_identity_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("created_at", "issuer_url", "subject", "updated_at", "user_id", "user_identity_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 UserIdentity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserIdentity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UserIdentity is not found in the empty JSON string", UserIdentity.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserIdentity.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("issuer_url") != null && !jsonObj.get("issuer_url").isJsonNull()) && !jsonObj.get("issuer_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_url").toString())); + } + if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserIdentity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserIdentity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserIdentity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserIdentity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserIdentity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserIdentity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserIdentity given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserIdentity + * @throws IOException if the JSON string is invalid with respect to UserIdentity + */ + public static UserIdentity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserIdentity.class); + } + + /** + * Convert an instance of UserIdentity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/UserProfile.java b/src/main/java/ai/reveng/model/UserProfile.java new file mode 100644 index 0000000..e4b800b --- /dev/null +++ b/src/main/java/ai/reveng/model/UserProfile.java @@ -0,0 +1,321 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * UserProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserProfile { + public static final String SERIALIZED_NAME_DEFAULT_TEAM_ID = "default_team_id"; + @SerializedName(SERIALIZED_NAME_DEFAULT_TEAM_ID) + @javax.annotation.Nullable + private Long defaultTeamId; + + public static final String SERIALIZED_NAME_FIRST_NAME = "first_name"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nonnull + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nonnull + private String lastName; + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nonnull + private String timeZone; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public UserProfile() { + } + + public UserProfile defaultTeamId(@javax.annotation.Nullable Long defaultTeamId) { + this.defaultTeamId = defaultTeamId; + return this; + } + + /** + * Get defaultTeamId + * @return defaultTeamId + */ + @javax.annotation.Nullable + public Long getDefaultTeamId() { + return defaultTeamId; + } + + public void setDefaultTeamId(@javax.annotation.Nullable Long defaultTeamId) { + this.defaultTeamId = defaultTeamId; + } + + + public UserProfile firstName(@javax.annotation.Nonnull String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nonnull + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nonnull String firstName) { + this.firstName = firstName; + } + + + public UserProfile lastName(@javax.annotation.Nonnull String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nonnull + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nonnull String lastName) { + this.lastName = lastName; + } + + + public UserProfile timeZone(@javax.annotation.Nonnull String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nonnull + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nonnull String timeZone) { + this.timeZone = timeZone; + } + + + public UserProfile 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; + } + + + + @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.defaultTeamId, userProfile.defaultTeamId) && + Objects.equals(this.firstName, userProfile.firstName) && + Objects.equals(this.lastName, userProfile.lastName) && + Objects.equals(this.timeZone, userProfile.timeZone) && + Objects.equals(this.username, userProfile.username); + } + + @Override + public int hashCode() { + return Objects.hash(defaultTeamId, firstName, lastName, timeZone, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfile {\n"); + sb.append(" defaultTeamId: ").append(toIndentedString(defaultTeamId)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("default_team_id", "first_name", "last_name", "time_zone", "username")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("first_name", "last_name", "time_zone", "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 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(java.util.Locale.ROOT, "The required field(s) %s in UserProfile is not found in the empty JSON string", UserProfile.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserProfile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `UserProfile` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserProfile.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("first_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_name").toString())); + } + if (!jsonObj.get("last_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_name").toString())); + } + if (!jsonObj.get("time_zone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `time_zone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_zone").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "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 TypeAdapter create(Gson gson, TypeToken type) { + if (!UserProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserProfile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.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); + } +} +