From 42368f3b4d05098975561e5df1117076ab7aad58 Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 19 Oct 2025 18:02:02 +0100 Subject: [PATCH] Refactor Go SDK API service names and add Java SDK Renamed Go SDK API services and documentation from BlockAPI/InfoAPI to BlockUtilsSdkClientGo/InfoUtilsSdkClientGo for consistency. Updated all references, method receivers, and usage examples accordingly. Added new Java SDK client, models, API, documentation, and build files under utils/sdk/client/java. Updated Go module dependencies and added go.sum. Enhanced Go models to support additional properties in JSON unmarshalling. --- utils/sdk/client/go/.openapi-generator/FILES | 4 +- utils/sdk/client/go/api_block.go | 108 +- utils/sdk/client/go/api_info.go | 49 +- utils/sdk/client/go/client.go | 8 +- .../{BlockAPI.md => BlockUtilsSdkClientGo.md} | 52 +- .../{InfoAPI.md => InfoUtilsSdkClientGo.md} | 22 +- utils/sdk/client/go/go.mod | 8 + utils/sdk/client/go/go.sum | 10 + .../client/go/model_block_details_model.go | 53 + ...odel_block_processing_performance_model.go | 44 + .../client/go/model_block_template_model.go | 37 + .../go/model_block_template_request_model.go | 35 + .../sdk/client/go/model_db_stat_info_model.go | 31 + utils/sdk/client/go/model_height_model.go | 29 + utils/sdk/client/go/model_info_model.go | 74 + .../client/go/model_maintainers_info_model.go | 33 + .../sdk/client/go/model_performance_model.go | 32 + utils/sdk/client/go/model_pos_entry_model.go | 36 + .../go/model_submit_block_request_model.go | 29 + .../go/model_submit_block_response_model.go | 29 + .../go/model_transaction_attachment_model.go | 31 + .../go/model_transaction_details_model.go | 41 + .../go/model_transaction_extra_model.go | 31 + .../go/model_transaction_input_model.go | 33 + .../go/model_transaction_output_model.go | 33 + .../go/model_tx_generation_context_model.go | 52 + .../go/model_tx_pool_performance_model.go | 39 + .../model_tx_processing_performance_model.go | 53 + utils/sdk/client/go/model_version_model.go | 33 + utils/sdk/client/go/test/api_block_test.go | 26 +- utils/sdk/client/go/test/api_info_test.go | 14 +- .../client/java/.github/workflows/maven.yml | 30 + utils/sdk/client/java/.gitignore | 21 + .../sdk/client/java/.openapi-generator-ignore | 3 + .../sdk/client/java/.openapi-generator/FILES | 77 + .../client/java/.openapi-generator/VERSION | 1 + utils/sdk/client/java/api/openapi.yaml | 1346 ++++++++++++++ utils/sdk/client/java/build.gradle | 166 ++ utils/sdk/client/java/build.sbt | 27 + utils/sdk/client/java/docs/BlockApi.md | 313 ++++ .../sdk/client/java/docs/BlockDetailsModel.md | 37 + .../docs/BlockProcessingPerformanceModel.md | 28 + .../client/java/docs/BlockTemplateModel.md | 21 + .../java/docs/BlockTemplateRequestModel.md | 19 + utils/sdk/client/java/docs/DbStatInfoModel.md | 15 + utils/sdk/client/java/docs/HeightModel.md | 13 + utils/sdk/client/java/docs/InfoApi.md | 128 ++ utils/sdk/client/java/docs/InfoModel.md | 58 + .../client/java/docs/MaintainersInfoModel.md | 17 + .../sdk/client/java/docs/PerformanceModel.md | 16 + utils/sdk/client/java/docs/PosEntryModel.md | 20 + .../java/docs/SubmitBlockRequestModel.md | 13 + .../java/docs/SubmitBlockResponseModel.md | 13 + .../java/docs/TransactionAttachmentModel.md | 15 + .../java/docs/TransactionDetailsModel.md | 25 + .../client/java/docs/TransactionExtraModel.md | 15 + .../client/java/docs/TransactionInputModel.md | 17 + .../java/docs/TransactionOutputModel.md | 17 + .../java/docs/TxGenerationContextModel.md | 36 + .../java/docs/TxPoolPerformanceModel.md | 23 + .../java/docs/TxProcessingPerformanceModel.md | 37 + utils/sdk/client/java/docs/VersionModel.md | 17 + utils/sdk/client/java/gradle.properties | 6 + .../java/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43453 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + utils/sdk/client/java/gradlew | 249 +++ utils/sdk/client/java/gradlew.bat | 92 + utils/sdk/client/java/pom.xml | 340 ++++ utils/sdk/client/java/settings.gradle | 1 + .../client/java/src/main/AndroidManifest.xml | 3 + .../java/invalidPackageName/ApiCallback.java | 62 + .../java/invalidPackageName/ApiClient.java | 1592 +++++++++++++++++ .../java/invalidPackageName/ApiException.java | 168 ++ .../java/invalidPackageName/ApiResponse.java | 76 + .../invalidPackageName/Configuration.java | 63 + .../GzipRequestInterceptor.java | 85 + .../main/java/invalidPackageName/JSON.java | 446 +++++ .../main/java/invalidPackageName/Pair.java | 37 + .../ProgressRequestBody.java | 73 + .../ProgressResponseBody.java | 70 + .../ServerConfiguration.java | 72 + .../invalidPackageName/ServerVariable.java | 37 + .../java/invalidPackageName/StringUtil.java | 83 + .../invalidPackageName/auth/ApiKeyAuth.java | 80 + .../auth/Authentication.java | 37 + .../auth/HttpBasicAuth.java | 55 + .../auth/HttpBearerAuth.java | 75 + .../java/src/main/java/lthn/BlockApi.java | 727 ++++++++ .../java/src/main/java/lthn/InfoApi.java | 318 ++++ .../src/main/java/org/lthn/ApiCallback.java | 62 + .../src/main/java/org/lthn/ApiClient.java | 1592 +++++++++++++++++ .../src/main/java/org/lthn/ApiException.java | 168 ++ .../src/main/java/org/lthn/ApiResponse.java | 76 + .../src/main/java/org/lthn/Configuration.java | 63 + .../java/org/lthn/GzipRequestInterceptor.java | 85 + .../java/src/main/java/org/lthn/JSON.java | 446 +++++ .../java/src/main/java/org/lthn/Pair.java | 37 + .../java/org/lthn/ProgressRequestBody.java | 73 + .../java/org/lthn/ProgressResponseBody.java | 70 + .../java/org/lthn/ServerConfiguration.java | 72 + .../main/java/org/lthn/ServerVariable.java | 37 + .../src/main/java/org/lthn/StringUtil.java | 83 + .../src/main/java/org/lthn/api/BlockApi.java | 727 ++++++++ .../src/main/java/org/lthn/api/InfoApi.java | 318 ++++ .../main/java/org/lthn/auth/ApiKeyAuth.java | 80 + .../java/org/lthn/auth/Authentication.java | 37 + .../java/org/lthn/auth/HttpBasicAuth.java | 55 + .../java/org/lthn/auth/HttpBearerAuth.java | 75 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1592 +++++++++++++++++ .../org/openapitools/client/ApiException.java | 168 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 63 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 446 +++++ .../java/org/openapitools/client/Pair.java | 37 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 72 + .../openapitools/client/ServerVariable.java | 37 + .../org/openapitools/client/StringUtil.java | 83 + .../org/openapitools/client/api/BlockApi.java | 727 ++++++++ .../org/openapitools/client/api/InfoApi.java | 318 ++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 37 + .../client/auth/HttpBasicAuth.java | 55 + .../client/auth/HttpBearerAuth.java | 75 + .../client/model/AbstractOpenApiSchema.java | 146 ++ .../client/model/BlockDetailsModel.java | 885 +++++++++ .../BlockProcessingPerformanceModel.java | 594 ++++++ .../client/model/BlockTemplateModel.java | 429 +++++ .../model/BlockTemplateRequestModel.java | 388 ++++ .../client/model/DbStatInfoModel.java | 256 +++ .../client/model/HeightModel.java | 204 +++ .../openapitools/client/model/InfoModel.java | 1444 +++++++++++++++ .../client/model/MaintainersInfoModel.java | 318 ++++ .../client/model/PerformanceModel.java | 302 ++++ .../client/model/PosEntryModel.java | 392 ++++ .../client/model/SubmitBlockRequestModel.java | 207 +++ .../model/SubmitBlockResponseModel.java | 207 +++ .../model/TransactionAttachmentModel.java | 265 +++ .../client/model/TransactionDetailsModel.java | 622 +++++++ .../client/model/TransactionExtraModel.java | 265 +++ .../client/model/TransactionInputModel.java | 330 ++++ .../client/model/TransactionOutputModel.java | 324 ++++ .../model/TxGenerationContextModel.java | 963 ++++++++++ .../client/model/TxPoolPerformanceModel.java | 464 +++++ .../model/TxProcessingPerformanceModel.java | 828 +++++++++ .../client/model/VersionModel.java | 323 ++++ .../java/src/test/java/lthn/BlockApiTest.java | 97 + .../java/src/test/java/lthn/InfoApiTest.java | 60 + .../test/java/org/lthn/api/BlockApiTest.java | 97 + .../test/java/org/lthn/api/InfoApiTest.java | 60 + .../openapitools/client/api/BlockApiTest.java | 97 + .../openapitools/client/api/InfoApiTest.java | 60 + .../client/model/BlockDetailsModelTest.java | 243 +++ .../BlockProcessingPerformanceModelTest.java | 168 ++ .../client/model/BlockTemplateModelTest.java | 113 ++ .../model/BlockTemplateRequestModelTest.java | 99 + .../client/model/DbStatInfoModelTest.java | 64 + .../client/model/HeightModelTest.java | 48 + .../client/model/InfoModelTest.java | 414 +++++ .../model/MaintainersInfoModelTest.java | 80 + .../client/model/PerformanceModelTest.java | 76 + .../client/model/PosEntryModelTest.java | 104 ++ .../model/SubmitBlockRequestModelTest.java | 48 + .../model/SubmitBlockResponseModelTest.java | 48 + .../model/TransactionAttachmentModelTest.java | 64 + .../model/TransactionDetailsModelTest.java | 150 ++ .../model/TransactionExtraModelTest.java | 64 + .../model/TransactionInputModelTest.java | 82 + .../model/TransactionOutputModelTest.java | 82 + .../model/TxGenerationContextModelTest.java | 234 +++ .../model/TxPoolPerformanceModelTest.java | 128 ++ .../TxProcessingPerformanceModelTest.java | 240 +++ .../client/model/VersionModelTest.java | 80 + utils/sdk/packages/java.json | 3 - utils/sdk/packages/php.json | 5 - 178 files changed, 29927 insertions(+), 196 deletions(-) rename utils/sdk/client/go/docs/{BlockAPI.md => BlockUtilsSdkClientGo.md} (71%) rename utils/sdk/client/go/docs/{InfoAPI.md => InfoUtilsSdkClientGo.md} (76%) create mode 100644 utils/sdk/client/go/go.sum create mode 100644 utils/sdk/client/java/.github/workflows/maven.yml create mode 100644 utils/sdk/client/java/.gitignore create mode 100644 utils/sdk/client/java/.openapi-generator-ignore create mode 100644 utils/sdk/client/java/.openapi-generator/FILES create mode 100644 utils/sdk/client/java/.openapi-generator/VERSION create mode 100644 utils/sdk/client/java/api/openapi.yaml create mode 100644 utils/sdk/client/java/build.gradle create mode 100644 utils/sdk/client/java/build.sbt create mode 100644 utils/sdk/client/java/docs/BlockApi.md create mode 100644 utils/sdk/client/java/docs/BlockDetailsModel.md create mode 100644 utils/sdk/client/java/docs/BlockProcessingPerformanceModel.md create mode 100644 utils/sdk/client/java/docs/BlockTemplateModel.md create mode 100644 utils/sdk/client/java/docs/BlockTemplateRequestModel.md create mode 100644 utils/sdk/client/java/docs/DbStatInfoModel.md create mode 100644 utils/sdk/client/java/docs/HeightModel.md create mode 100644 utils/sdk/client/java/docs/InfoApi.md create mode 100644 utils/sdk/client/java/docs/InfoModel.md create mode 100644 utils/sdk/client/java/docs/MaintainersInfoModel.md create mode 100644 utils/sdk/client/java/docs/PerformanceModel.md create mode 100644 utils/sdk/client/java/docs/PosEntryModel.md create mode 100644 utils/sdk/client/java/docs/SubmitBlockRequestModel.md create mode 100644 utils/sdk/client/java/docs/SubmitBlockResponseModel.md create mode 100644 utils/sdk/client/java/docs/TransactionAttachmentModel.md create mode 100644 utils/sdk/client/java/docs/TransactionDetailsModel.md create mode 100644 utils/sdk/client/java/docs/TransactionExtraModel.md create mode 100644 utils/sdk/client/java/docs/TransactionInputModel.md create mode 100644 utils/sdk/client/java/docs/TransactionOutputModel.md create mode 100644 utils/sdk/client/java/docs/TxGenerationContextModel.md create mode 100644 utils/sdk/client/java/docs/TxPoolPerformanceModel.md create mode 100644 utils/sdk/client/java/docs/TxProcessingPerformanceModel.md create mode 100644 utils/sdk/client/java/docs/VersionModel.md create mode 100644 utils/sdk/client/java/gradle.properties create mode 100644 utils/sdk/client/java/gradle/wrapper/gradle-wrapper.jar create mode 100644 utils/sdk/client/java/gradle/wrapper/gradle-wrapper.properties create mode 100644 utils/sdk/client/java/gradlew create mode 100644 utils/sdk/client/java/gradlew.bat create mode 100644 utils/sdk/client/java/pom.xml create mode 100644 utils/sdk/client/java/settings.gradle create mode 100644 utils/sdk/client/java/src/main/AndroidManifest.xml create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ApiCallback.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ApiClient.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ApiException.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ApiResponse.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/Configuration.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/GzipRequestInterceptor.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/JSON.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/Pair.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ProgressRequestBody.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ProgressResponseBody.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ServerConfiguration.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/ServerVariable.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/StringUtil.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/auth/ApiKeyAuth.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/auth/Authentication.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBasicAuth.java create mode 100644 utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBearerAuth.java create mode 100644 utils/sdk/client/java/src/main/java/lthn/BlockApi.java create mode 100644 utils/sdk/client/java/src/main/java/lthn/InfoApi.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ApiCallback.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ApiClient.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ApiException.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ApiResponse.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/Configuration.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/GzipRequestInterceptor.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/JSON.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/Pair.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ProgressRequestBody.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ProgressResponseBody.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ServerConfiguration.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/ServerVariable.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/StringUtil.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/api/BlockApi.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/api/InfoApi.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/auth/ApiKeyAuth.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/auth/Authentication.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBasicAuth.java create mode 100644 utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBearerAuth.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ApiException.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/Configuration.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/JSON.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/Pair.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/api/BlockApi.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/api/InfoApi.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockDetailsModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockProcessingPerformanceModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateRequestModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/DbStatInfoModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/HeightModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/InfoModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/MaintainersInfoModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/PerformanceModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/PosEntryModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockRequestModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockResponseModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionAttachmentModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionDetailsModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionExtraModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionInputModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionOutputModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxGenerationContextModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxPoolPerformanceModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxProcessingPerformanceModel.java create mode 100644 utils/sdk/client/java/src/main/java/org/openapitools/client/model/VersionModel.java create mode 100644 utils/sdk/client/java/src/test/java/lthn/BlockApiTest.java create mode 100644 utils/sdk/client/java/src/test/java/lthn/InfoApiTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/lthn/api/BlockApiTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/lthn/api/InfoApiTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/api/BlockApiTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/api/InfoApiTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockDetailsModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockProcessingPerformanceModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateRequestModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/DbStatInfoModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/HeightModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/InfoModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/MaintainersInfoModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/PerformanceModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/PosEntryModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockRequestModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockResponseModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionAttachmentModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionDetailsModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionExtraModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionInputModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionOutputModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxGenerationContextModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxPoolPerformanceModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxProcessingPerformanceModelTest.java create mode 100644 utils/sdk/client/java/src/test/java/org/openapitools/client/model/VersionModelTest.java diff --git a/utils/sdk/client/go/.openapi-generator/FILES b/utils/sdk/client/go/.openapi-generator/FILES index bf9e05fb..88ee5612 100644 --- a/utils/sdk/client/go/.openapi-generator/FILES +++ b/utils/sdk/client/go/.openapi-generator/FILES @@ -4,15 +4,15 @@ api_block.go api_info.go client.go configuration.go -docs/BlockAPI.md docs/BlockDetailsModel.md docs/BlockProcessingPerformanceModel.md docs/BlockTemplateModel.md docs/BlockTemplateRequestModel.md +docs/BlockUtilsSdkClientGo.md docs/DbStatInfoModel.md docs/HeightModel.md -docs/InfoAPI.md docs/InfoModel.md +docs/InfoUtilsSdkClientGo.md docs/MaintainersInfoModel.md docs/PerformanceModel.md docs/PosEntryModel.md diff --git a/utils/sdk/client/go/api_block.go b/utils/sdk/client/go/api_block.go index 198cf11a..6de31f85 100644 --- a/utils/sdk/client/go/api_block.go +++ b/utils/sdk/client/go/api_block.go @@ -20,76 +20,12 @@ import ( ) -type BlockAPI interface { - - /* - CreateBlockTemplate Create a block template for mining - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateBlockTemplateRequest - */ - CreateBlockTemplate(ctx context.Context) ApiCreateBlockTemplateRequest - - // CreateBlockTemplateExecute executes the request - // @return BlockTemplateModel - CreateBlockTemplateExecute(r ApiCreateBlockTemplateRequest) (*BlockTemplateModel, *http.Response, error) - - /* - GetBlock Get a block by its hash or height (ID) - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param identifier The hash (hex string) or height (integer) of the block to retrieve. - @return ApiGetBlockRequest - */ - GetBlock(ctx context.Context, identifier string) ApiGetBlockRequest - - // GetBlockExecute executes the request - // @return BlockDetailsModel - GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsModel, *http.Response, error) - - /* - GetBlocks Get one or more blocks, with optional pagination. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetBlocksRequest - */ - GetBlocks(ctx context.Context) ApiGetBlocksRequest - - // GetBlocksExecute executes the request - // @return []BlockDetailsModel - GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetailsModel, *http.Response, error) - - /* - GetHeight Get the current blockchain height - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetHeightRequest - */ - GetHeight(ctx context.Context) ApiGetHeightRequest - - // GetHeightExecute executes the request - // @return HeightModel - GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, *http.Response, error) - - /* - SubmitBlock Submit a new block to the network - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiSubmitBlockRequest - */ - SubmitBlock(ctx context.Context) ApiSubmitBlockRequest - - // SubmitBlockExecute executes the request - // @return SubmitBlockResponseModel - SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBlockResponseModel, *http.Response, error) -} - -// BlockAPIService BlockAPI service -type BlockAPIService service +// BlockUtilsSdkClientGoService BlockUtilsSdkClientGo service +type BlockUtilsSdkClientGoService service type ApiCreateBlockTemplateRequest struct { ctx context.Context - ApiService BlockAPI + ApiService *BlockUtilsSdkClientGoService blockTemplateRequestModel *BlockTemplateRequestModel } @@ -108,7 +44,7 @@ CreateBlockTemplate Create a block template for mining @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateBlockTemplateRequest */ -func (a *BlockAPIService) CreateBlockTemplate(ctx context.Context) ApiCreateBlockTemplateRequest { +func (a *BlockUtilsSdkClientGoService) CreateBlockTemplate(ctx context.Context) ApiCreateBlockTemplateRequest { return ApiCreateBlockTemplateRequest{ ApiService: a, ctx: ctx, @@ -117,7 +53,7 @@ func (a *BlockAPIService) CreateBlockTemplate(ctx context.Context) ApiCreateBloc // Execute executes the request // @return BlockTemplateModel -func (a *BlockAPIService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateRequest) (*BlockTemplateModel, *http.Response, error) { +func (a *BlockUtilsSdkClientGoService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateRequest) (*BlockTemplateModel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -125,7 +61,7 @@ func (a *BlockAPIService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateReq localVarReturnValue *BlockTemplateModel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.CreateBlockTemplate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.CreateBlockTemplate") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -197,7 +133,7 @@ func (a *BlockAPIService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateReq type ApiGetBlockRequest struct { ctx context.Context - ApiService BlockAPI + ApiService *BlockUtilsSdkClientGoService identifier string } @@ -212,7 +148,7 @@ GetBlock Get a block by its hash or height (ID) @param identifier The hash (hex string) or height (integer) of the block to retrieve. @return ApiGetBlockRequest */ -func (a *BlockAPIService) GetBlock(ctx context.Context, identifier string) ApiGetBlockRequest { +func (a *BlockUtilsSdkClientGoService) GetBlock(ctx context.Context, identifier string) ApiGetBlockRequest { return ApiGetBlockRequest{ ApiService: a, ctx: ctx, @@ -222,7 +158,7 @@ func (a *BlockAPIService) GetBlock(ctx context.Context, identifier string) ApiGe // Execute executes the request // @return BlockDetailsModel -func (a *BlockAPIService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsModel, *http.Response, error) { +func (a *BlockUtilsSdkClientGoService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsModel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -230,7 +166,7 @@ func (a *BlockAPIService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsMo localVarReturnValue *BlockDetailsModel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.GetBlock") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.GetBlock") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -298,7 +234,7 @@ func (a *BlockAPIService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsMo type ApiGetBlocksRequest struct { ctx context.Context - ApiService BlockAPI + ApiService *BlockUtilsSdkClientGoService } func (r ApiGetBlocksRequest) Execute() ([]BlockDetailsModel, *http.Response, error) { @@ -311,7 +247,7 @@ GetBlocks Get one or more blocks, with optional pagination. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiGetBlocksRequest */ -func (a *BlockAPIService) GetBlocks(ctx context.Context) ApiGetBlocksRequest { +func (a *BlockUtilsSdkClientGoService) GetBlocks(ctx context.Context) ApiGetBlocksRequest { return ApiGetBlocksRequest{ ApiService: a, ctx: ctx, @@ -320,7 +256,7 @@ func (a *BlockAPIService) GetBlocks(ctx context.Context) ApiGetBlocksRequest { // Execute executes the request // @return []BlockDetailsModel -func (a *BlockAPIService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetailsModel, *http.Response, error) { +func (a *BlockUtilsSdkClientGoService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetailsModel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -328,7 +264,7 @@ func (a *BlockAPIService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetail localVarReturnValue []BlockDetailsModel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.GetBlocks") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.GetBlocks") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -395,7 +331,7 @@ func (a *BlockAPIService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetail type ApiGetHeightRequest struct { ctx context.Context - ApiService BlockAPI + ApiService *BlockUtilsSdkClientGoService } func (r ApiGetHeightRequest) Execute() (*HeightModel, *http.Response, error) { @@ -408,7 +344,7 @@ GetHeight Get the current blockchain height @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiGetHeightRequest */ -func (a *BlockAPIService) GetHeight(ctx context.Context) ApiGetHeightRequest { +func (a *BlockUtilsSdkClientGoService) GetHeight(ctx context.Context) ApiGetHeightRequest { return ApiGetHeightRequest{ ApiService: a, ctx: ctx, @@ -417,7 +353,7 @@ func (a *BlockAPIService) GetHeight(ctx context.Context) ApiGetHeightRequest { // Execute executes the request // @return HeightModel -func (a *BlockAPIService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, *http.Response, error) { +func (a *BlockUtilsSdkClientGoService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -425,7 +361,7 @@ func (a *BlockAPIService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, localVarReturnValue *HeightModel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.GetHeight") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.GetHeight") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -492,7 +428,7 @@ func (a *BlockAPIService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, type ApiSubmitBlockRequest struct { ctx context.Context - ApiService BlockAPI + ApiService *BlockUtilsSdkClientGoService submitBlockRequestModel *SubmitBlockRequestModel } @@ -511,7 +447,7 @@ SubmitBlock Submit a new block to the network @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiSubmitBlockRequest */ -func (a *BlockAPIService) SubmitBlock(ctx context.Context) ApiSubmitBlockRequest { +func (a *BlockUtilsSdkClientGoService) SubmitBlock(ctx context.Context) ApiSubmitBlockRequest { return ApiSubmitBlockRequest{ ApiService: a, ctx: ctx, @@ -520,7 +456,7 @@ func (a *BlockAPIService) SubmitBlock(ctx context.Context) ApiSubmitBlockRequest // Execute executes the request // @return SubmitBlockResponseModel -func (a *BlockAPIService) SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBlockResponseModel, *http.Response, error) { +func (a *BlockUtilsSdkClientGoService) SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBlockResponseModel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -528,7 +464,7 @@ func (a *BlockAPIService) SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBl localVarReturnValue *SubmitBlockResponseModel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.SubmitBlock") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.SubmitBlock") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } diff --git a/utils/sdk/client/go/api_info.go b/utils/sdk/client/go/api_info.go index 8482eee6..ed06494c 100644 --- a/utils/sdk/client/go/api_info.go +++ b/utils/sdk/client/go/api_info.go @@ -19,41 +19,12 @@ import ( ) -type InfoAPI interface { - - /* - GetInfo Get detailed information about the blockchain and daemon state - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetInfoRequest - */ - GetInfo(ctx context.Context) ApiGetInfoRequest - - // GetInfoExecute executes the request - // @return InfoModel - GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.Response, error) - - /* - Version Get API version - - Returns the current version of the API. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiVersionRequest - */ - Version(ctx context.Context) ApiVersionRequest - - // VersionExecute executes the request - // @return VersionModel - VersionExecute(r ApiVersionRequest) (*VersionModel, *http.Response, error) -} - -// InfoAPIService InfoAPI service -type InfoAPIService service +// InfoUtilsSdkClientGoService InfoUtilsSdkClientGo service +type InfoUtilsSdkClientGoService service type ApiGetInfoRequest struct { ctx context.Context - ApiService InfoAPI + ApiService *InfoUtilsSdkClientGoService flags *string } @@ -73,7 +44,7 @@ GetInfo Get detailed information about the blockchain and daemon state @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiGetInfoRequest */ -func (a *InfoAPIService) GetInfo(ctx context.Context) ApiGetInfoRequest { +func (a *InfoUtilsSdkClientGoService) GetInfo(ctx context.Context) ApiGetInfoRequest { return ApiGetInfoRequest{ ApiService: a, ctx: ctx, @@ -82,7 +53,7 @@ func (a *InfoAPIService) GetInfo(ctx context.Context) ApiGetInfoRequest { // Execute executes the request // @return InfoModel -func (a *InfoAPIService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.Response, error) { +func (a *InfoUtilsSdkClientGoService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -90,7 +61,7 @@ func (a *InfoAPIService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http. localVarReturnValue *InfoModel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoAPIService.GetInfo") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoUtilsSdkClientGoService.GetInfo") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -160,7 +131,7 @@ func (a *InfoAPIService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http. type ApiVersionRequest struct { ctx context.Context - ApiService InfoAPI + ApiService *InfoUtilsSdkClientGoService } func (r ApiVersionRequest) Execute() (*VersionModel, *http.Response, error) { @@ -175,7 +146,7 @@ Returns the current version of the API. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiVersionRequest */ -func (a *InfoAPIService) Version(ctx context.Context) ApiVersionRequest { +func (a *InfoUtilsSdkClientGoService) Version(ctx context.Context) ApiVersionRequest { return ApiVersionRequest{ ApiService: a, ctx: ctx, @@ -184,7 +155,7 @@ func (a *InfoAPIService) Version(ctx context.Context) ApiVersionRequest { // Execute executes the request // @return VersionModel -func (a *InfoAPIService) VersionExecute(r ApiVersionRequest) (*VersionModel, *http.Response, error) { +func (a *InfoUtilsSdkClientGoService) VersionExecute(r ApiVersionRequest) (*VersionModel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -192,7 +163,7 @@ func (a *InfoAPIService) VersionExecute(r ApiVersionRequest) (*VersionModel, *ht localVarReturnValue *VersionModel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoAPIService.Version") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoUtilsSdkClientGoService.Version") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } diff --git a/utils/sdk/client/go/client.go b/utils/sdk/client/go/client.go index 58ab003e..15b0d6c4 100644 --- a/utils/sdk/client/go/client.go +++ b/utils/sdk/client/go/client.go @@ -49,9 +49,9 @@ type APIClient struct { // API Services - BlockAPI BlockAPI + BlockUtilsSdkClientGo *BlockUtilsSdkClientGoService - InfoAPI InfoAPI + InfoUtilsSdkClientGo *InfoUtilsSdkClientGoService } type service struct { @@ -70,8 +70,8 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services - c.BlockAPI = (*BlockAPIService)(&c.common) - c.InfoAPI = (*InfoAPIService)(&c.common) + c.BlockUtilsSdkClientGo = (*BlockUtilsSdkClientGoService)(&c.common) + c.InfoUtilsSdkClientGo = (*InfoUtilsSdkClientGoService)(&c.common) return c } diff --git a/utils/sdk/client/go/docs/BlockAPI.md b/utils/sdk/client/go/docs/BlockUtilsSdkClientGo.md similarity index 71% rename from utils/sdk/client/go/docs/BlockAPI.md rename to utils/sdk/client/go/docs/BlockUtilsSdkClientGo.md index 68550462..7035e8b2 100644 --- a/utils/sdk/client/go/docs/BlockAPI.md +++ b/utils/sdk/client/go/docs/BlockUtilsSdkClientGo.md @@ -1,14 +1,14 @@ -# \BlockAPI +# \BlockUtilsSdkClientGo All URIs are relative to *http://127.0.0.1:36943* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CreateBlockTemplate**](BlockAPI.md#CreateBlockTemplate) | **Post** /block/template | Create a block template for mining -[**GetBlock**](BlockAPI.md#GetBlock) | **Get** /block/{identifier} | Get a block by its hash or height (ID) -[**GetBlocks**](BlockAPI.md#GetBlocks) | **Get** /block | Get one or more blocks, with optional pagination. -[**GetHeight**](BlockAPI.md#GetHeight) | **Get** /block/height | Get the current blockchain height -[**SubmitBlock**](BlockAPI.md#SubmitBlock) | **Post** /block/submit | Submit a new block to the network +[**CreateBlockTemplate**](BlockUtilsSdkClientGo.md#CreateBlockTemplate) | **Post** /block/template | Create a block template for mining +[**GetBlock**](BlockUtilsSdkClientGo.md#GetBlock) | **Get** /block/{identifier} | Get a block by its hash or height (ID) +[**GetBlocks**](BlockUtilsSdkClientGo.md#GetBlocks) | **Get** /block | Get one or more blocks, with optional pagination. +[**GetHeight**](BlockUtilsSdkClientGo.md#GetHeight) | **Get** /block/height | Get the current blockchain height +[**SubmitBlock**](BlockUtilsSdkClientGo.md#SubmitBlock) | **Post** /block/submit | Submit a new block to the network @@ -27,7 +27,7 @@ import ( "context" "fmt" "os" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) func main() { @@ -35,13 +35,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BlockAPI.CreateBlockTemplate(context.Background()).BlockTemplateRequestModel(blockTemplateRequestModel).Execute() + resp, r, err := apiClient.BlockUtilsSdkClientGo.CreateBlockTemplate(context.Background()).BlockTemplateRequestModel(blockTemplateRequestModel).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.CreateBlockTemplate``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.CreateBlockTemplate``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CreateBlockTemplate`: BlockTemplateModel - fmt.Fprintf(os.Stdout, "Response from `BlockAPI.CreateBlockTemplate`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.CreateBlockTemplate`: %v\n", resp) } ``` @@ -91,7 +91,7 @@ import ( "context" "fmt" "os" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) func main() { @@ -99,13 +99,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BlockAPI.GetBlock(context.Background(), identifier).Execute() + resp, r, err := apiClient.BlockUtilsSdkClientGo.GetBlock(context.Background(), identifier).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.GetBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.GetBlock``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetBlock`: BlockDetailsModel - fmt.Fprintf(os.Stdout, "Response from `BlockAPI.GetBlock`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.GetBlock`: %v\n", resp) } ``` @@ -159,20 +159,20 @@ import ( "context" "fmt" "os" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BlockAPI.GetBlocks(context.Background()).Execute() + resp, r, err := apiClient.BlockUtilsSdkClientGo.GetBlocks(context.Background()).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.GetBlocks``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.GetBlocks``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetBlocks`: []BlockDetailsModel - fmt.Fprintf(os.Stdout, "Response from `BlockAPI.GetBlocks`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.GetBlocks`: %v\n", resp) } ``` @@ -218,20 +218,20 @@ import ( "context" "fmt" "os" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BlockAPI.GetHeight(context.Background()).Execute() + resp, r, err := apiClient.BlockUtilsSdkClientGo.GetHeight(context.Background()).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.GetHeight``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.GetHeight``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetHeight`: HeightModel - fmt.Fprintf(os.Stdout, "Response from `BlockAPI.GetHeight`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.GetHeight`: %v\n", resp) } ``` @@ -277,7 +277,7 @@ import ( "context" "fmt" "os" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) func main() { @@ -285,13 +285,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BlockAPI.SubmitBlock(context.Background()).SubmitBlockRequestModel(submitBlockRequestModel).Execute() + resp, r, err := apiClient.BlockUtilsSdkClientGo.SubmitBlock(context.Background()).SubmitBlockRequestModel(submitBlockRequestModel).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.SubmitBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.SubmitBlock``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `SubmitBlock`: SubmitBlockResponseModel - fmt.Fprintf(os.Stdout, "Response from `BlockAPI.SubmitBlock`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.SubmitBlock`: %v\n", resp) } ``` diff --git a/utils/sdk/client/go/docs/InfoAPI.md b/utils/sdk/client/go/docs/InfoUtilsSdkClientGo.md similarity index 76% rename from utils/sdk/client/go/docs/InfoAPI.md rename to utils/sdk/client/go/docs/InfoUtilsSdkClientGo.md index 5a86f33a..4b406020 100644 --- a/utils/sdk/client/go/docs/InfoAPI.md +++ b/utils/sdk/client/go/docs/InfoUtilsSdkClientGo.md @@ -1,11 +1,11 @@ -# \InfoAPI +# \InfoUtilsSdkClientGo All URIs are relative to *http://127.0.0.1:36943* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetInfo**](InfoAPI.md#GetInfo) | **Get** /info | Get detailed information about the blockchain and daemon state -[**Version**](InfoAPI.md#Version) | **Get** /info/version | Get API version +[**GetInfo**](InfoUtilsSdkClientGo.md#GetInfo) | **Get** /info | Get detailed information about the blockchain and daemon state +[**Version**](InfoUtilsSdkClientGo.md#Version) | **Get** /info/version | Get API version @@ -24,7 +24,7 @@ import ( "context" "fmt" "os" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) func main() { @@ -32,13 +32,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.InfoAPI.GetInfo(context.Background()).Flags(flags).Execute() + resp, r, err := apiClient.InfoUtilsSdkClientGo.GetInfo(context.Background()).Flags(flags).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.GetInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `InfoUtilsSdkClientGo.GetInfo``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetInfo`: InfoModel - fmt.Fprintf(os.Stdout, "Response from `InfoAPI.GetInfo`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `InfoUtilsSdkClientGo.GetInfo`: %v\n", resp) } ``` @@ -90,20 +90,20 @@ import ( "context" "fmt" "os" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.InfoAPI.Version(context.Background()).Execute() + resp, r, err := apiClient.InfoUtilsSdkClientGo.Version(context.Background()).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.Version``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `InfoUtilsSdkClientGo.Version``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `Version`: VersionModel - fmt.Fprintf(os.Stdout, "Response from `InfoAPI.Version`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `InfoUtilsSdkClientGo.Version`: %v\n", resp) } ``` diff --git a/utils/sdk/client/go/go.mod b/utils/sdk/client/go/go.mod index c8166dd0..754b6d85 100644 --- a/utils/sdk/client/go/go.mod +++ b/utils/sdk/client/go/go.mod @@ -1,3 +1,11 @@ module github.com/letheanVPN/blockchain/utils/sdk/client/go go 1.23 + +require github.com/stretchr/testify v1.11.1 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/utils/sdk/client/go/go.sum b/utils/sdk/client/go/go.sum new file mode 100644 index 00000000..c4c1710c --- /dev/null +++ b/utils/sdk/client/go/go.sum @@ -0,0 +1,10 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/utils/sdk/client/go/model_block_details_model.go b/utils/sdk/client/go/model_block_details_model.go index 6d8f369e..026d7288 100644 --- a/utils/sdk/client/go/model_block_details_model.go +++ b/utils/sdk/client/go/model_block_details_model.go @@ -44,8 +44,11 @@ type BlockDetailsModel struct { TotalTxsSize *int32 `json:"total_txs_size,omitempty"` TransactionsDetails []TransactionDetailsModel `json:"transactions_details,omitempty"` Type *int32 `json:"type,omitempty"` + AdditionalProperties map[string]interface{} } +type _BlockDetailsModel BlockDetailsModel + // NewBlockDetailsModel instantiates a new BlockDetailsModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -948,9 +951,59 @@ func (o BlockDetailsModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.Type) { toSerialize["type"] = o.Type } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *BlockDetailsModel) UnmarshalJSON(data []byte) (err error) { + varBlockDetailsModel := _BlockDetailsModel{} + + err = json.Unmarshal(data, &varBlockDetailsModel) + + if err != nil { + return err + } + + *o = BlockDetailsModel(varBlockDetailsModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "actual_timestamp") + delete(additionalProperties, "already_generated_coins") + delete(additionalProperties, "base_reward") + delete(additionalProperties, "blob") + delete(additionalProperties, "block_cumulative_size") + delete(additionalProperties, "block_tself_size") + delete(additionalProperties, "cumulative_diff_adjusted") + delete(additionalProperties, "cumulative_diff_precise") + delete(additionalProperties, "difficulty") + delete(additionalProperties, "effective_fee_median") + delete(additionalProperties, "height") + delete(additionalProperties, "id") + delete(additionalProperties, "is_orphan") + delete(additionalProperties, "miner_text_info") + delete(additionalProperties, "object_in_json") + delete(additionalProperties, "penalty") + delete(additionalProperties, "pow_seed") + delete(additionalProperties, "prev_id") + delete(additionalProperties, "summary_reward") + delete(additionalProperties, "this_block_fee_median") + delete(additionalProperties, "timestamp") + delete(additionalProperties, "total_fee") + delete(additionalProperties, "total_txs_size") + delete(additionalProperties, "transactions_details") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableBlockDetailsModel struct { value *BlockDetailsModel isSet bool diff --git a/utils/sdk/client/go/model_block_processing_performance_model.go b/utils/sdk/client/go/model_block_processing_performance_model.go index 582149a2..6e6ef525 100644 --- a/utils/sdk/client/go/model_block_processing_performance_model.go +++ b/utils/sdk/client/go/model_block_processing_performance_model.go @@ -35,8 +35,11 @@ type BlockProcessingPerformanceModel struct { PosValidateKiSearch *int32 `json:"pos_validate_ki_search,omitempty"` PosValidateGetOutKeysForInputs *int32 `json:"pos_validate_get_out_keys_for_inputs,omitempty"` PosValidateZvp *int32 `json:"pos_validate_zvp,omitempty"` + AdditionalProperties map[string]interface{} } +type _BlockProcessingPerformanceModel BlockProcessingPerformanceModel + // NewBlockProcessingPerformanceModel instantiates a new BlockProcessingPerformanceModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -624,9 +627,50 @@ func (o BlockProcessingPerformanceModel) ToMap() (map[string]interface{}, error) if !IsNil(o.PosValidateZvp) { toSerialize["pos_validate_zvp"] = o.PosValidateZvp } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *BlockProcessingPerformanceModel) UnmarshalJSON(data []byte) (err error) { + varBlockProcessingPerformanceModel := _BlockProcessingPerformanceModel{} + + err = json.Unmarshal(data, &varBlockProcessingPerformanceModel) + + if err != nil { + return err + } + + *o = BlockProcessingPerformanceModel(varBlockProcessingPerformanceModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "block_processing_time_0") + delete(additionalProperties, "block_processing_time_1") + delete(additionalProperties, "target_calculating_time_2") + delete(additionalProperties, "longhash_calculating_time_3") + delete(additionalProperties, "all_txs_insert_time_5") + delete(additionalProperties, "etc_stuff_6") + delete(additionalProperties, "insert_time_4") + delete(additionalProperties, "raise_block_core_event") + delete(additionalProperties, "validate_miner_transaction_time") + delete(additionalProperties, "collect_rangeproofs_data_from_tx_time") + delete(additionalProperties, "verify_multiple_zc_outs_range_proofs_time") + delete(additionalProperties, "target_calculating_enum_blocks") + delete(additionalProperties, "target_calculating_calc") + delete(additionalProperties, "pos_validate_ki_search") + delete(additionalProperties, "pos_validate_get_out_keys_for_inputs") + delete(additionalProperties, "pos_validate_zvp") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableBlockProcessingPerformanceModel struct { value *BlockProcessingPerformanceModel isSet bool diff --git a/utils/sdk/client/go/model_block_template_model.go b/utils/sdk/client/go/model_block_template_model.go index 48245106..56081a71 100644 --- a/utils/sdk/client/go/model_block_template_model.go +++ b/utils/sdk/client/go/model_block_template_model.go @@ -28,8 +28,11 @@ type BlockTemplateModel struct { TxsFee *int32 `json:"txs_fee,omitempty"` PrevHash *string `json:"prev_hash,omitempty"` Seed *string `json:"seed,omitempty"` + AdditionalProperties map[string]interface{} } +type _BlockTemplateModel BlockTemplateModel + // NewBlockTemplateModel instantiates a new BlockTemplateModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -372,9 +375,43 @@ func (o BlockTemplateModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.Seed) { toSerialize["seed"] = o.Seed } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *BlockTemplateModel) UnmarshalJSON(data []byte) (err error) { + varBlockTemplateModel := _BlockTemplateModel{} + + err = json.Unmarshal(data, &varBlockTemplateModel) + + if err != nil { + return err + } + + *o = BlockTemplateModel(varBlockTemplateModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "blocktemplate_blob") + delete(additionalProperties, "difficulty") + delete(additionalProperties, "height") + delete(additionalProperties, "miner_tx_tgc") + delete(additionalProperties, "block_reward_without_fee") + delete(additionalProperties, "block_reward") + delete(additionalProperties, "txs_fee") + delete(additionalProperties, "prev_hash") + delete(additionalProperties, "seed") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableBlockTemplateModel struct { value *BlockTemplateModel isSet bool diff --git a/utils/sdk/client/go/model_block_template_request_model.go b/utils/sdk/client/go/model_block_template_request_model.go index 624a5619..da7f08b2 100644 --- a/utils/sdk/client/go/model_block_template_request_model.go +++ b/utils/sdk/client/go/model_block_template_request_model.go @@ -26,8 +26,11 @@ type BlockTemplateRequestModel struct { IgnorePowTsCheck *bool `json:"ignore_pow_ts_check,omitempty"` Pe *PosEntryModel `json:"pe,omitempty"` ExplicitTxs []string `json:"explicit_txs,omitempty"` + AdditionalProperties map[string]interface{} } +type _BlockTemplateRequestModel BlockTemplateRequestModel + // NewBlockTemplateRequestModel instantiates a new BlockTemplateRequestModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -300,9 +303,41 @@ func (o BlockTemplateRequestModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExplicitTxs) { toSerialize["explicit_txs"] = o.ExplicitTxs } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *BlockTemplateRequestModel) UnmarshalJSON(data []byte) (err error) { + varBlockTemplateRequestModel := _BlockTemplateRequestModel{} + + err = json.Unmarshal(data, &varBlockTemplateRequestModel) + + if err != nil { + return err + } + + *o = BlockTemplateRequestModel(varBlockTemplateRequestModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "miner_address") + delete(additionalProperties, "stakeholder_address") + delete(additionalProperties, "ex_nonce") + delete(additionalProperties, "pos_block") + delete(additionalProperties, "ignore_pow_ts_check") + delete(additionalProperties, "pe") + delete(additionalProperties, "explicit_txs") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableBlockTemplateRequestModel struct { value *BlockTemplateRequestModel isSet bool diff --git a/utils/sdk/client/go/model_db_stat_info_model.go b/utils/sdk/client/go/model_db_stat_info_model.go index 5f2f49cd..075fd0c9 100644 --- a/utils/sdk/client/go/model_db_stat_info_model.go +++ b/utils/sdk/client/go/model_db_stat_info_model.go @@ -22,8 +22,11 @@ type DbStatInfoModel struct { TxCount *int32 `json:"tx_count,omitempty"` WriteTxCount *int32 `json:"write_tx_count,omitempty"` MapSize *int32 `json:"map_size,omitempty"` + AdditionalProperties map[string]interface{} } +type _DbStatInfoModel DbStatInfoModel + // NewDbStatInfoModel instantiates a new DbStatInfoModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -156,9 +159,37 @@ func (o DbStatInfoModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.MapSize) { toSerialize["map_size"] = o.MapSize } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DbStatInfoModel) UnmarshalJSON(data []byte) (err error) { + varDbStatInfoModel := _DbStatInfoModel{} + + err = json.Unmarshal(data, &varDbStatInfoModel) + + if err != nil { + return err + } + + *o = DbStatInfoModel(varDbStatInfoModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tx_count") + delete(additionalProperties, "write_tx_count") + delete(additionalProperties, "map_size") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDbStatInfoModel struct { value *DbStatInfoModel isSet bool diff --git a/utils/sdk/client/go/model_height_model.go b/utils/sdk/client/go/model_height_model.go index e9a44933..f35301c1 100644 --- a/utils/sdk/client/go/model_height_model.go +++ b/utils/sdk/client/go/model_height_model.go @@ -20,8 +20,11 @@ var _ MappedNullable = &HeightModel{} // HeightModel struct for HeightModel type HeightModel struct { Height *int32 `json:"height,omitempty"` + AdditionalProperties map[string]interface{} } +type _HeightModel HeightModel + // NewHeightModel instantiates a new HeightModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -84,9 +87,35 @@ func (o HeightModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.Height) { toSerialize["height"] = o.Height } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *HeightModel) UnmarshalJSON(data []byte) (err error) { + varHeightModel := _HeightModel{} + + err = json.Unmarshal(data, &varHeightModel) + + if err != nil { + return err + } + + *o = HeightModel(varHeightModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "height") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableHeightModel struct { value *HeightModel isSet bool diff --git a/utils/sdk/client/go/model_info_model.go b/utils/sdk/client/go/model_info_model.go index 68bbad82..378193c8 100644 --- a/utils/sdk/client/go/model_info_model.go +++ b/utils/sdk/client/go/model_info_model.go @@ -65,8 +65,11 @@ type InfoModel struct { PerformanceData *PerformanceModel `json:"performance_data,omitempty"` OffersCount *int32 `json:"offers_count,omitempty"` ExpirationMedianTimestamp *int32 `json:"expiration_median_timestamp,omitempty"` + AdditionalProperties map[string]interface{} } +type _InfoModel InfoModel + // NewInfoModel instantiates a new InfoModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -1704,9 +1707,80 @@ func (o InfoModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExpirationMedianTimestamp) { toSerialize["expiration_median_timestamp"] = o.ExpirationMedianTimestamp } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *InfoModel) UnmarshalJSON(data []byte) (err error) { + varInfoModel := _InfoModel{} + + err = json.Unmarshal(data, &varInfoModel) + + if err != nil { + return err + } + + *o = InfoModel(varInfoModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "height") + delete(additionalProperties, "tx_count") + delete(additionalProperties, "tx_pool_size") + delete(additionalProperties, "alt_blocks_count") + delete(additionalProperties, "outgoing_connections_count") + delete(additionalProperties, "incoming_connections_count") + delete(additionalProperties, "synchronized_connections_count") + delete(additionalProperties, "white_peerlist_size") + delete(additionalProperties, "grey_peerlist_size") + delete(additionalProperties, "current_blocks_median") + delete(additionalProperties, "alias_count") + delete(additionalProperties, "current_max_allowed_block_size") + delete(additionalProperties, "daemon_network_state") + delete(additionalProperties, "synchronization_start_height") + delete(additionalProperties, "max_net_seen_height") + delete(additionalProperties, "mi") + delete(additionalProperties, "pos_allowed") + delete(additionalProperties, "pos_difficulty") + delete(additionalProperties, "pow_difficulty") + delete(additionalProperties, "default_fee") + delete(additionalProperties, "minimum_fee") + delete(additionalProperties, "is_hardfork_active") + delete(additionalProperties, "net_time_delta_median") + delete(additionalProperties, "current_network_hashrate_50") + delete(additionalProperties, "current_network_hashrate_350") + delete(additionalProperties, "seconds_for_10_blocks") + delete(additionalProperties, "seconds_for_30_blocks") + delete(additionalProperties, "transactions_cnt_per_day") + delete(additionalProperties, "transactions_volume_per_day") + delete(additionalProperties, "last_pos_timestamp") + delete(additionalProperties, "last_pow_timestamp") + delete(additionalProperties, "total_coins") + delete(additionalProperties, "last_block_size") + delete(additionalProperties, "tx_count_in_last_block") + delete(additionalProperties, "pos_sequence_factor") + delete(additionalProperties, "pow_sequence_factor") + delete(additionalProperties, "block_reward") + delete(additionalProperties, "last_block_total_reward") + delete(additionalProperties, "pos_diff_total_coins_rate") + delete(additionalProperties, "last_block_timestamp") + delete(additionalProperties, "last_block_hash") + delete(additionalProperties, "pos_block_ts_shift_vs_actual") + delete(additionalProperties, "outs_stat") + delete(additionalProperties, "performance_data") + delete(additionalProperties, "offers_count") + delete(additionalProperties, "expiration_median_timestamp") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInfoModel struct { value *InfoModel isSet bool diff --git a/utils/sdk/client/go/model_maintainers_info_model.go b/utils/sdk/client/go/model_maintainers_info_model.go index d7ce5a0f..b187324c 100644 --- a/utils/sdk/client/go/model_maintainers_info_model.go +++ b/utils/sdk/client/go/model_maintainers_info_model.go @@ -24,8 +24,11 @@ type MaintainersInfoModel struct { VerRevision *int32 `json:"ver_revision,omitempty"` BuildNo *int32 `json:"build_no,omitempty"` Mode *int32 `json:"mode,omitempty"` + AdditionalProperties map[string]interface{} } +type _MaintainersInfoModel MaintainersInfoModel + // NewMaintainersInfoModel instantiates a new MaintainersInfoModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -228,9 +231,39 @@ func (o MaintainersInfoModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.Mode) { toSerialize["mode"] = o.Mode } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *MaintainersInfoModel) UnmarshalJSON(data []byte) (err error) { + varMaintainersInfoModel := _MaintainersInfoModel{} + + err = json.Unmarshal(data, &varMaintainersInfoModel) + + if err != nil { + return err + } + + *o = MaintainersInfoModel(varMaintainersInfoModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "ver_major") + delete(additionalProperties, "ver_minor") + delete(additionalProperties, "ver_revision") + delete(additionalProperties, "build_no") + delete(additionalProperties, "mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableMaintainersInfoModel struct { value *MaintainersInfoModel isSet bool diff --git a/utils/sdk/client/go/model_performance_model.go b/utils/sdk/client/go/model_performance_model.go index 07787996..8842c712 100644 --- a/utils/sdk/client/go/model_performance_model.go +++ b/utils/sdk/client/go/model_performance_model.go @@ -23,8 +23,11 @@ type PerformanceModel struct { TxProcessing *TxProcessingPerformanceModel `json:"tx_processing,omitempty"` TxPool *TxPoolPerformanceModel `json:"tx_pool,omitempty"` DbStatInfo *DbStatInfoModel `json:"db_stat_info,omitempty"` + AdditionalProperties map[string]interface{} } +type _PerformanceModel PerformanceModel + // NewPerformanceModel instantiates a new PerformanceModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -192,9 +195,38 @@ func (o PerformanceModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.DbStatInfo) { toSerialize["db_stat_info"] = o.DbStatInfo } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *PerformanceModel) UnmarshalJSON(data []byte) (err error) { + varPerformanceModel := _PerformanceModel{} + + err = json.Unmarshal(data, &varPerformanceModel) + + if err != nil { + return err + } + + *o = PerformanceModel(varPerformanceModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "block_processing") + delete(additionalProperties, "tx_processing") + delete(additionalProperties, "tx_pool") + delete(additionalProperties, "db_stat_info") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullablePerformanceModel struct { value *PerformanceModel isSet bool diff --git a/utils/sdk/client/go/model_pos_entry_model.go b/utils/sdk/client/go/model_pos_entry_model.go index 92877f0c..901a7100 100644 --- a/utils/sdk/client/go/model_pos_entry_model.go +++ b/utils/sdk/client/go/model_pos_entry_model.go @@ -27,8 +27,11 @@ type PosEntryModel struct { TxId *string `json:"tx_id,omitempty"` TxOutIndex *int32 `json:"tx_out_index,omitempty"` WalletIndex *int32 `json:"wallet_index,omitempty"` + AdditionalProperties map[string]interface{} } +type _PosEntryModel PosEntryModel + // NewPosEntryModel instantiates a new PosEntryModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -336,9 +339,42 @@ func (o PosEntryModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.WalletIndex) { toSerialize["wallet_index"] = o.WalletIndex } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *PosEntryModel) UnmarshalJSON(data []byte) (err error) { + varPosEntryModel := _PosEntryModel{} + + err = json.Unmarshal(data, &varPosEntryModel) + + if err != nil { + return err + } + + *o = PosEntryModel(varPosEntryModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "g_index") + delete(additionalProperties, "keyimage") + delete(additionalProperties, "block_timestamp") + delete(additionalProperties, "stake_unlock_time") + delete(additionalProperties, "tx_id") + delete(additionalProperties, "tx_out_index") + delete(additionalProperties, "wallet_index") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullablePosEntryModel struct { value *PosEntryModel isSet bool diff --git a/utils/sdk/client/go/model_submit_block_request_model.go b/utils/sdk/client/go/model_submit_block_request_model.go index 3ab0e7c4..5b67c95a 100644 --- a/utils/sdk/client/go/model_submit_block_request_model.go +++ b/utils/sdk/client/go/model_submit_block_request_model.go @@ -20,8 +20,11 @@ var _ MappedNullable = &SubmitBlockRequestModel{} // SubmitBlockRequestModel struct for SubmitBlockRequestModel type SubmitBlockRequestModel struct { BlockBlob *string `json:"block_blob,omitempty"` + AdditionalProperties map[string]interface{} } +type _SubmitBlockRequestModel SubmitBlockRequestModel + // NewSubmitBlockRequestModel instantiates a new SubmitBlockRequestModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -84,9 +87,35 @@ func (o SubmitBlockRequestModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.BlockBlob) { toSerialize["block_blob"] = o.BlockBlob } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *SubmitBlockRequestModel) UnmarshalJSON(data []byte) (err error) { + varSubmitBlockRequestModel := _SubmitBlockRequestModel{} + + err = json.Unmarshal(data, &varSubmitBlockRequestModel) + + if err != nil { + return err + } + + *o = SubmitBlockRequestModel(varSubmitBlockRequestModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "block_blob") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableSubmitBlockRequestModel struct { value *SubmitBlockRequestModel isSet bool diff --git a/utils/sdk/client/go/model_submit_block_response_model.go b/utils/sdk/client/go/model_submit_block_response_model.go index 6d94d558..d922dfd0 100644 --- a/utils/sdk/client/go/model_submit_block_response_model.go +++ b/utils/sdk/client/go/model_submit_block_response_model.go @@ -20,8 +20,11 @@ var _ MappedNullable = &SubmitBlockResponseModel{} // SubmitBlockResponseModel struct for SubmitBlockResponseModel type SubmitBlockResponseModel struct { Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _SubmitBlockResponseModel SubmitBlockResponseModel + // NewSubmitBlockResponseModel instantiates a new SubmitBlockResponseModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -84,9 +87,35 @@ func (o SubmitBlockResponseModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.Status) { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *SubmitBlockResponseModel) UnmarshalJSON(data []byte) (err error) { + varSubmitBlockResponseModel := _SubmitBlockResponseModel{} + + err = json.Unmarshal(data, &varSubmitBlockResponseModel) + + if err != nil { + return err + } + + *o = SubmitBlockResponseModel(varSubmitBlockResponseModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableSubmitBlockResponseModel struct { value *SubmitBlockResponseModel isSet bool diff --git a/utils/sdk/client/go/model_transaction_attachment_model.go b/utils/sdk/client/go/model_transaction_attachment_model.go index 721587be..0c105fdc 100644 --- a/utils/sdk/client/go/model_transaction_attachment_model.go +++ b/utils/sdk/client/go/model_transaction_attachment_model.go @@ -22,8 +22,11 @@ type TransactionAttachmentModel struct { Type *string `json:"type,omitempty"` ShortView *string `json:"short_view,omitempty"` DetailsView *string `json:"details_view,omitempty"` + AdditionalProperties map[string]interface{} } +type _TransactionAttachmentModel TransactionAttachmentModel + // NewTransactionAttachmentModel instantiates a new TransactionAttachmentModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -156,9 +159,37 @@ func (o TransactionAttachmentModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.DetailsView) { toSerialize["details_view"] = o.DetailsView } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TransactionAttachmentModel) UnmarshalJSON(data []byte) (err error) { + varTransactionAttachmentModel := _TransactionAttachmentModel{} + + err = json.Unmarshal(data, &varTransactionAttachmentModel) + + if err != nil { + return err + } + + *o = TransactionAttachmentModel(varTransactionAttachmentModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "short_view") + delete(additionalProperties, "details_view") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTransactionAttachmentModel struct { value *TransactionAttachmentModel isSet bool diff --git a/utils/sdk/client/go/model_transaction_details_model.go b/utils/sdk/client/go/model_transaction_details_model.go index 9e6fa06d..8843457a 100644 --- a/utils/sdk/client/go/model_transaction_details_model.go +++ b/utils/sdk/client/go/model_transaction_details_model.go @@ -32,8 +32,11 @@ type TransactionDetailsModel struct { Outs []TransactionOutputModel `json:"outs,omitempty"` PubKey *string `json:"pub_key,omitempty"` Timestamp *int32 `json:"timestamp,omitempty"` + AdditionalProperties map[string]interface{} } +type _TransactionDetailsModel TransactionDetailsModel + // NewTransactionDetailsModel instantiates a new TransactionDetailsModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -516,9 +519,47 @@ func (o TransactionDetailsModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.Timestamp) { toSerialize["timestamp"] = o.Timestamp } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TransactionDetailsModel) UnmarshalJSON(data []byte) (err error) { + varTransactionDetailsModel := _TransactionDetailsModel{} + + err = json.Unmarshal(data, &varTransactionDetailsModel) + + if err != nil { + return err + } + + *o = TransactionDetailsModel(varTransactionDetailsModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "attachments") + delete(additionalProperties, "blob") + delete(additionalProperties, "blob_size") + delete(additionalProperties, "extra") + delete(additionalProperties, "fee") + delete(additionalProperties, "id") + delete(additionalProperties, "ins") + delete(additionalProperties, "keeper_block") + delete(additionalProperties, "object_in_json") + delete(additionalProperties, "outs") + delete(additionalProperties, "pub_key") + delete(additionalProperties, "timestamp") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTransactionDetailsModel struct { value *TransactionDetailsModel isSet bool diff --git a/utils/sdk/client/go/model_transaction_extra_model.go b/utils/sdk/client/go/model_transaction_extra_model.go index 2423ca32..fcaed466 100644 --- a/utils/sdk/client/go/model_transaction_extra_model.go +++ b/utils/sdk/client/go/model_transaction_extra_model.go @@ -22,8 +22,11 @@ type TransactionExtraModel struct { Type *string `json:"type,omitempty"` ShortView *string `json:"short_view,omitempty"` DetailsView *string `json:"details_view,omitempty"` + AdditionalProperties map[string]interface{} } +type _TransactionExtraModel TransactionExtraModel + // NewTransactionExtraModel instantiates a new TransactionExtraModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -156,9 +159,37 @@ func (o TransactionExtraModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.DetailsView) { toSerialize["details_view"] = o.DetailsView } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TransactionExtraModel) UnmarshalJSON(data []byte) (err error) { + varTransactionExtraModel := _TransactionExtraModel{} + + err = json.Unmarshal(data, &varTransactionExtraModel) + + if err != nil { + return err + } + + *o = TransactionExtraModel(varTransactionExtraModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "short_view") + delete(additionalProperties, "details_view") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTransactionExtraModel struct { value *TransactionExtraModel isSet bool diff --git a/utils/sdk/client/go/model_transaction_input_model.go b/utils/sdk/client/go/model_transaction_input_model.go index 3721470b..244e4c69 100644 --- a/utils/sdk/client/go/model_transaction_input_model.go +++ b/utils/sdk/client/go/model_transaction_input_model.go @@ -24,8 +24,11 @@ type TransactionInputModel struct { HtlcOrigin *string `json:"htlc_origin,omitempty"` KimageOrMsId *string `json:"kimage_or_ms_id,omitempty"` MultisigCount *int32 `json:"multisig_count,omitempty"` + AdditionalProperties map[string]interface{} } +type _TransactionInputModel TransactionInputModel + // NewTransactionInputModel instantiates a new TransactionInputModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -228,9 +231,39 @@ func (o TransactionInputModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.MultisigCount) { toSerialize["multisig_count"] = o.MultisigCount } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TransactionInputModel) UnmarshalJSON(data []byte) (err error) { + varTransactionInputModel := _TransactionInputModel{} + + err = json.Unmarshal(data, &varTransactionInputModel) + + if err != nil { + return err + } + + *o = TransactionInputModel(varTransactionInputModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "global_indexes") + delete(additionalProperties, "htlc_origin") + delete(additionalProperties, "kimage_or_ms_id") + delete(additionalProperties, "multisig_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTransactionInputModel struct { value *TransactionInputModel isSet bool diff --git a/utils/sdk/client/go/model_transaction_output_model.go b/utils/sdk/client/go/model_transaction_output_model.go index 1bc0eb90..1d73b766 100644 --- a/utils/sdk/client/go/model_transaction_output_model.go +++ b/utils/sdk/client/go/model_transaction_output_model.go @@ -24,8 +24,11 @@ type TransactionOutputModel struct { IsSpent *bool `json:"is_spent,omitempty"` MinimumSigs *int32 `json:"minimum_sigs,omitempty"` PubKeys []string `json:"pub_keys,omitempty"` + AdditionalProperties map[string]interface{} } +type _TransactionOutputModel TransactionOutputModel + // NewTransactionOutputModel instantiates a new TransactionOutputModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -228,9 +231,39 @@ func (o TransactionOutputModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.PubKeys) { toSerialize["pub_keys"] = o.PubKeys } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TransactionOutputModel) UnmarshalJSON(data []byte) (err error) { + varTransactionOutputModel := _TransactionOutputModel{} + + err = json.Unmarshal(data, &varTransactionOutputModel) + + if err != nil { + return err + } + + *o = TransactionOutputModel(varTransactionOutputModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "global_index") + delete(additionalProperties, "is_spent") + delete(additionalProperties, "minimum_sigs") + delete(additionalProperties, "pub_keys") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTransactionOutputModel struct { value *TransactionOutputModel isSet bool diff --git a/utils/sdk/client/go/model_tx_generation_context_model.go b/utils/sdk/client/go/model_tx_generation_context_model.go index 1d9a42fe..9647fbfc 100644 --- a/utils/sdk/client/go/model_tx_generation_context_model.go +++ b/utils/sdk/client/go/model_tx_generation_context_model.go @@ -43,8 +43,11 @@ type TxGenerationContextModel struct { TxKeyPub *string `json:"tx_key_pub,omitempty"` TxKeySec *string `json:"tx_key_sec,omitempty"` TxPubKeyP *string `json:"tx_pub_key_p,omitempty"` + AdditionalProperties map[string]interface{} } +type _TxGenerationContextModel TxGenerationContextModel + // NewTxGenerationContextModel instantiates a new TxGenerationContextModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -912,9 +915,58 @@ func (o TxGenerationContextModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.TxPubKeyP) { toSerialize["tx_pub_key_p"] = o.TxPubKeyP } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TxGenerationContextModel) UnmarshalJSON(data []byte) (err error) { + varTxGenerationContextModel := _TxGenerationContextModel{} + + err = json.Unmarshal(data, &varTxGenerationContextModel) + + if err != nil { + return err + } + + *o = TxGenerationContextModel(varTxGenerationContextModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "asset_ids") + delete(additionalProperties, "blinded_asset_ids") + delete(additionalProperties, "amount_commitments") + delete(additionalProperties, "asset_id_blinding_masks") + delete(additionalProperties, "amounts") + delete(additionalProperties, "amount_blinding_masks") + delete(additionalProperties, "pseudo_outs_blinded_asset_ids") + delete(additionalProperties, "pseudo_outs_plus_real_out_blinding_masks") + delete(additionalProperties, "real_zc_ins_asset_ids") + delete(additionalProperties, "zc_input_amounts") + delete(additionalProperties, "pseudo_out_amount_commitments_sum") + delete(additionalProperties, "pseudo_out_amount_blinding_masks_sum") + delete(additionalProperties, "real_in_asset_id_blinding_mask_x_amount_sum") + delete(additionalProperties, "amount_commitments_sum") + delete(additionalProperties, "amount_blinding_masks_sum") + delete(additionalProperties, "asset_id_blinding_mask_x_amount_sum") + delete(additionalProperties, "ao_asset_id") + delete(additionalProperties, "ao_asset_id_pt") + delete(additionalProperties, "ao_amount_commitment") + delete(additionalProperties, "ao_amount_blinding_mask") + delete(additionalProperties, "ao_commitment_in_outputs") + delete(additionalProperties, "tx_key_pub") + delete(additionalProperties, "tx_key_sec") + delete(additionalProperties, "tx_pub_key_p") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTxGenerationContextModel struct { value *TxGenerationContextModel isSet bool diff --git a/utils/sdk/client/go/model_tx_pool_performance_model.go b/utils/sdk/client/go/model_tx_pool_performance_model.go index 445df184..291840e6 100644 --- a/utils/sdk/client/go/model_tx_pool_performance_model.go +++ b/utils/sdk/client/go/model_tx_pool_performance_model.go @@ -30,8 +30,11 @@ type TxPoolPerformanceModel struct { UpdateDbTime *int32 `json:"update_db_time,omitempty"` DbCommitTime *int32 `json:"db_commit_time,omitempty"` CheckPostHf4Balance *int32 `json:"check_post_hf4_balance,omitempty"` + AdditionalProperties map[string]interface{} } +type _TxPoolPerformanceModel TxPoolPerformanceModel + // NewTxPoolPerformanceModel instantiates a new TxPoolPerformanceModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -444,9 +447,45 @@ func (o TxPoolPerformanceModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.CheckPostHf4Balance) { toSerialize["check_post_hf4_balance"] = o.CheckPostHf4Balance } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TxPoolPerformanceModel) UnmarshalJSON(data []byte) (err error) { + varTxPoolPerformanceModel := _TxPoolPerformanceModel{} + + err = json.Unmarshal(data, &varTxPoolPerformanceModel) + + if err != nil { + return err + } + + *o = TxPoolPerformanceModel(varTxPoolPerformanceModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tx_processing_time") + delete(additionalProperties, "check_inputs_types_supported_time") + delete(additionalProperties, "expiration_validate_time") + delete(additionalProperties, "validate_amount_time") + delete(additionalProperties, "validate_alias_time") + delete(additionalProperties, "check_keyimages_ws_ms_time") + delete(additionalProperties, "check_inputs_time") + delete(additionalProperties, "begin_tx_time") + delete(additionalProperties, "update_db_time") + delete(additionalProperties, "db_commit_time") + delete(additionalProperties, "check_post_hf4_balance") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTxPoolPerformanceModel struct { value *TxPoolPerformanceModel isSet bool diff --git a/utils/sdk/client/go/model_tx_processing_performance_model.go b/utils/sdk/client/go/model_tx_processing_performance_model.go index bd0d8200..1073c2f9 100644 --- a/utils/sdk/client/go/model_tx_processing_performance_model.go +++ b/utils/sdk/client/go/model_tx_processing_performance_model.go @@ -44,8 +44,11 @@ type TxProcessingPerformanceModel struct { TxCheckInputsLoopScanOutputkeysLoopFindTx *int32 `json:"tx_check_inputs_loop_scan_outputkeys_loop_find_tx,omitempty"` TxCheckInputsLoopScanOutputkeysLoopHandleOutput *int32 `json:"tx_check_inputs_loop_scan_outputkeys_loop_handle_output,omitempty"` TxMixinCount *int32 `json:"tx_mixin_count,omitempty"` + AdditionalProperties map[string]interface{} } +type _TxProcessingPerformanceModel TxProcessingPerformanceModel + // NewTxProcessingPerformanceModel instantiates a new TxProcessingPerformanceModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -948,9 +951,59 @@ func (o TxProcessingPerformanceModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.TxMixinCount) { toSerialize["tx_mixin_count"] = o.TxMixinCount } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TxProcessingPerformanceModel) UnmarshalJSON(data []byte) (err error) { + varTxProcessingPerformanceModel := _TxProcessingPerformanceModel{} + + err = json.Unmarshal(data, &varTxProcessingPerformanceModel) + + if err != nil { + return err + } + + *o = TxProcessingPerformanceModel(varTxProcessingPerformanceModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tx_check_inputs") + delete(additionalProperties, "tx_add_one_tx") + delete(additionalProperties, "tx_process_extra") + delete(additionalProperties, "tx_process_attachment") + delete(additionalProperties, "tx_process_inputs") + delete(additionalProperties, "tx_push_global_index") + delete(additionalProperties, "tx_check_exist") + delete(additionalProperties, "tx_print_log") + delete(additionalProperties, "tx_prapare_append") + delete(additionalProperties, "tx_append") + delete(additionalProperties, "tx_append_rl_wait") + delete(additionalProperties, "tx_append_is_expired") + delete(additionalProperties, "tx_store_db") + delete(additionalProperties, "tx_check_inputs_prefix_hash") + delete(additionalProperties, "tx_check_inputs_attachment_check") + delete(additionalProperties, "tx_check_inputs_loop") + delete(additionalProperties, "tx_check_inputs_loop_kimage_check") + delete(additionalProperties, "tx_check_inputs_loop_ch_in_val_sig") + delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_get_item_size") + delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_relative_to_absolute") + delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop") + delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop_get_subitem") + delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop_find_tx") + delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop_handle_output") + delete(additionalProperties, "tx_mixin_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTxProcessingPerformanceModel struct { value *TxProcessingPerformanceModel isSet bool diff --git a/utils/sdk/client/go/model_version_model.go b/utils/sdk/client/go/model_version_model.go index cbd649d5..2a78b757 100644 --- a/utils/sdk/client/go/model_version_model.go +++ b/utils/sdk/client/go/model_version_model.go @@ -24,8 +24,11 @@ type VersionModel struct { Major *string `json:"major,omitempty"` Minor *string `json:"minor,omitempty"` Revision *string `json:"revision,omitempty"` + AdditionalProperties map[string]interface{} } +type _VersionModel VersionModel + // NewVersionModel instantiates a new VersionModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -228,9 +231,39 @@ func (o VersionModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.Revision) { toSerialize["revision"] = o.Revision } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *VersionModel) UnmarshalJSON(data []byte) (err error) { + varVersionModel := _VersionModel{} + + err = json.Unmarshal(data, &varVersionModel) + + if err != nil { + return err + } + + *o = VersionModel(varVersionModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "version") + delete(additionalProperties, "version_long") + delete(additionalProperties, "major") + delete(additionalProperties, "minor") + delete(additionalProperties, "revision") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableVersionModel struct { value *VersionModel isSet bool diff --git a/utils/sdk/client/go/test/api_block_test.go b/utils/sdk/client/go/test/api_block_test.go index 4f34e1e5..3a9d7152 100644 --- a/utils/sdk/client/go/test/api_block_test.go +++ b/utils/sdk/client/go/test/api_block_test.go @@ -1,7 +1,7 @@ /* Lethean Blockchain API -Testing BlockAPIService +Testing BlockUtilsSdkClientGoService */ @@ -14,19 +14,19 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "testing" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) -func Test_lthn_BlockAPIService(t *testing.T) { +func Test_lthn_BlockUtilsSdkClientGoService(t *testing.T) { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - t.Run("Test BlockAPIService CreateBlockTemplate", func(t *testing.T) { + t.Run("Test BlockUtilsSdkClientGoService CreateBlockTemplate", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.BlockAPI.CreateBlockTemplate(context.Background()).Execute() + resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.CreateBlockTemplate(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -34,13 +34,13 @@ func Test_lthn_BlockAPIService(t *testing.T) { }) - t.Run("Test BlockAPIService GetBlock", func(t *testing.T) { + t.Run("Test BlockUtilsSdkClientGoService GetBlock", func(t *testing.T) { t.Skip("skip test") // remove to run test var identifier string - resp, httpRes, err := apiClient.BlockAPI.GetBlock(context.Background(), identifier).Execute() + resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.GetBlock(context.Background(), identifier).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -48,11 +48,11 @@ func Test_lthn_BlockAPIService(t *testing.T) { }) - t.Run("Test BlockAPIService GetBlocks", func(t *testing.T) { + t.Run("Test BlockUtilsSdkClientGoService GetBlocks", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.BlockAPI.GetBlocks(context.Background()).Execute() + resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.GetBlocks(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -60,11 +60,11 @@ func Test_lthn_BlockAPIService(t *testing.T) { }) - t.Run("Test BlockAPIService GetHeight", func(t *testing.T) { + t.Run("Test BlockUtilsSdkClientGoService GetHeight", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.BlockAPI.GetHeight(context.Background()).Execute() + resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.GetHeight(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -72,11 +72,11 @@ func Test_lthn_BlockAPIService(t *testing.T) { }) - t.Run("Test BlockAPIService SubmitBlock", func(t *testing.T) { + t.Run("Test BlockUtilsSdkClientGoService SubmitBlock", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.BlockAPI.SubmitBlock(context.Background()).Execute() + resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.SubmitBlock(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/utils/sdk/client/go/test/api_info_test.go b/utils/sdk/client/go/test/api_info_test.go index 2662cef0..1b9ee6ef 100644 --- a/utils/sdk/client/go/test/api_info_test.go +++ b/utils/sdk/client/go/test/api_info_test.go @@ -1,7 +1,7 @@ /* Lethean Blockchain API -Testing InfoAPIService +Testing InfoUtilsSdkClientGoService */ @@ -14,19 +14,19 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "testing" - openapiclient "github.com/letheanVPN/blockchain/lthn" + openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go" ) -func Test_lthn_InfoAPIService(t *testing.T) { +func Test_lthn_InfoUtilsSdkClientGoService(t *testing.T) { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - t.Run("Test InfoAPIService GetInfo", func(t *testing.T) { + t.Run("Test InfoUtilsSdkClientGoService GetInfo", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.InfoAPI.GetInfo(context.Background()).Execute() + resp, httpRes, err := apiClient.InfoUtilsSdkClientGo.GetInfo(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -34,11 +34,11 @@ func Test_lthn_InfoAPIService(t *testing.T) { }) - t.Run("Test InfoAPIService Version", func(t *testing.T) { + t.Run("Test InfoUtilsSdkClientGoService Version", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.InfoAPI.Version(context.Background()).Execute() + resp, httpRes, err := apiClient.InfoUtilsSdkClientGo.Version(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) diff --git a/utils/sdk/client/java/.github/workflows/maven.yml b/utils/sdk/client/java/.github/workflows/maven.yml new file mode 100644 index 00000000..25db77ed --- /dev/null +++ b/utils/sdk/client/java/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Lethean Blockchain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/utils/sdk/client/java/.gitignore b/utils/sdk/client/java/.gitignore new file mode 100644 index 00000000..a530464a --- /dev/null +++ b/utils/sdk/client/java/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/utils/sdk/client/java/.openapi-generator-ignore b/utils/sdk/client/java/.openapi-generator-ignore new file mode 100644 index 00000000..def5120f --- /dev/null +++ b/utils/sdk/client/java/.openapi-generator-ignore @@ -0,0 +1,3 @@ +git_push.sh +.travis.yml +README.md diff --git a/utils/sdk/client/java/.openapi-generator/FILES b/utils/sdk/client/java/.openapi-generator/FILES new file mode 100644 index 00000000..2d911bf2 --- /dev/null +++ b/utils/sdk/client/java/.openapi-generator/FILES @@ -0,0 +1,77 @@ +.github/workflows/maven.yml +.gitignore +api/openapi.yaml +build.gradle +build.sbt +docs/BlockApi.md +docs/BlockDetailsModel.md +docs/BlockProcessingPerformanceModel.md +docs/BlockTemplateModel.md +docs/BlockTemplateRequestModel.md +docs/DbStatInfoModel.md +docs/HeightModel.md +docs/InfoApi.md +docs/InfoModel.md +docs/MaintainersInfoModel.md +docs/PerformanceModel.md +docs/PosEntryModel.md +docs/SubmitBlockRequestModel.md +docs/SubmitBlockResponseModel.md +docs/TransactionAttachmentModel.md +docs/TransactionDetailsModel.md +docs/TransactionExtraModel.md +docs/TransactionInputModel.md +docs/TransactionOutputModel.md +docs/TxGenerationContextModel.md +docs/TxPoolPerformanceModel.md +docs/TxProcessingPerformanceModel.md +docs/VersionModel.md +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/invalidPackageName/ApiCallback.java +src/main/java/invalidPackageName/ApiClient.java +src/main/java/invalidPackageName/ApiException.java +src/main/java/invalidPackageName/ApiResponse.java +src/main/java/invalidPackageName/Configuration.java +src/main/java/invalidPackageName/GzipRequestInterceptor.java +src/main/java/invalidPackageName/JSON.java +src/main/java/invalidPackageName/Pair.java +src/main/java/invalidPackageName/ProgressRequestBody.java +src/main/java/invalidPackageName/ProgressResponseBody.java +src/main/java/invalidPackageName/ServerConfiguration.java +src/main/java/invalidPackageName/ServerVariable.java +src/main/java/invalidPackageName/StringUtil.java +src/main/java/invalidPackageName/auth/ApiKeyAuth.java +src/main/java/invalidPackageName/auth/Authentication.java +src/main/java/invalidPackageName/auth/HttpBasicAuth.java +src/main/java/invalidPackageName/auth/HttpBearerAuth.java +src/main/java/lthn/BlockApi.java +src/main/java/lthn/InfoApi.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/BlockDetailsModel.java +src/main/java/org/openapitools/client/model/BlockProcessingPerformanceModel.java +src/main/java/org/openapitools/client/model/BlockTemplateModel.java +src/main/java/org/openapitools/client/model/BlockTemplateRequestModel.java +src/main/java/org/openapitools/client/model/DbStatInfoModel.java +src/main/java/org/openapitools/client/model/HeightModel.java +src/main/java/org/openapitools/client/model/InfoModel.java +src/main/java/org/openapitools/client/model/MaintainersInfoModel.java +src/main/java/org/openapitools/client/model/PerformanceModel.java +src/main/java/org/openapitools/client/model/PosEntryModel.java +src/main/java/org/openapitools/client/model/SubmitBlockRequestModel.java +src/main/java/org/openapitools/client/model/SubmitBlockResponseModel.java +src/main/java/org/openapitools/client/model/TransactionAttachmentModel.java +src/main/java/org/openapitools/client/model/TransactionDetailsModel.java +src/main/java/org/openapitools/client/model/TransactionExtraModel.java +src/main/java/org/openapitools/client/model/TransactionInputModel.java +src/main/java/org/openapitools/client/model/TransactionOutputModel.java +src/main/java/org/openapitools/client/model/TxGenerationContextModel.java +src/main/java/org/openapitools/client/model/TxPoolPerformanceModel.java +src/main/java/org/openapitools/client/model/TxProcessingPerformanceModel.java +src/main/java/org/openapitools/client/model/VersionModel.java diff --git a/utils/sdk/client/java/.openapi-generator/VERSION b/utils/sdk/client/java/.openapi-generator/VERSION new file mode 100644 index 00000000..971ecb25 --- /dev/null +++ b/utils/sdk/client/java/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.16.0 diff --git a/utils/sdk/client/java/api/openapi.yaml b/utils/sdk/client/java/api/openapi.yaml new file mode 100644 index 00000000..3d925546 --- /dev/null +++ b/utils/sdk/client/java/api/openapi.yaml @@ -0,0 +1,1346 @@ +openapi: 3.0.0 +info: + contact: + name: Lethean + url: https://lt.hn/ + description: OpenAPI for Lethean Blockchain + license: + name: EUPL-1.2 + url: https://joinup.ec.europa.eu/software/page/eupl/licence-eupl + title: Lethean Blockchain API + version: 6.0.1 +servers: +- description: Local Daemon + url: http://127.0.0.1:36943 +- description: Seed Server + url: http://seed.lethean.io:36943 +paths: + /info: + get: + operationId: getInfo + parameters: + - deprecated: false + description: "Possible values: net_time_delta_median, current_network_hashrate_50,\ + \ current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks,\ + \ transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins,\ + \ last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor,\ + \ pos_difficulty, performance, outs_stat, expirations_median." + explode: true + in: query + name: flags + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/InfoModel" + description: OK + summary: Get detailed information about the blockchain and daemon state + tags: + - Info + x-accepts: + - application/json + /info/version: + get: + description: Returns the current version of the API. + operationId: version + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/VersionModel" + description: OK + summary: Get API version + tags: + - Info + x-accepts: + - application/json + /block: + get: + operationId: getBlocks + parameters: [] + responses: + "404": + description: text/plain + "400": + description: text/plain + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/BlockDetailsModel" + type: array + description: A list of block objects. + summary: "Get one or more blocks, with optional pagination." + tags: + - Block + x-accepts: + - application/json + /block/template: + post: + operationId: createBlockTemplate + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/BlockTemplateRequestModel" + required: true + responses: + "500": + description: text/plain + "400": + description: text/plain + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BlockTemplateModel" + description: OK + summary: Create a block template for mining + tags: + - Block + x-content-type: application/json + x-accepts: + - application/json + /block/submit: + post: + operationId: submitBlock + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SubmitBlockRequestModel" + required: true + responses: + "406": + description: text/plain + "400": + description: text/plain + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SubmitBlockResponseModel" + description: OK + summary: Submit a new block to the network + tags: + - Block + x-content-type: application/json + x-accepts: + - application/json + /block/height: + get: + operationId: getHeight + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HeightModel" + description: OK + summary: Get the current blockchain height + tags: + - Block + x-accepts: + - application/json + /block/{identifier}: + get: + operationId: getBlock + parameters: + - deprecated: false + description: The hash (hex string) or height (integer) of the block to retrieve. + explode: false + in: path + name: identifier + required: true + schema: + type: string + style: simple + responses: + "404": + description: text/plain + "400": + description: text/plain + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BlockDetailsModel" + description: OK + summary: Get a block by its hash or height (ID) + tags: + - Block + x-accepts: + - application/json +components: + schemas: + DbStatInfoModel: + example: + write_tx_count: 4 + tx_count: 8 + map_size: 0 + properties: + tx_count: + type: integer + write_tx_count: + type: integer + map_size: + type: integer + type: object + TxPoolPerformanceModel: + example: + begin_tx_time: 0 + db_commit_time: 2 + validate_amount_time: 3 + update_db_time: 3 + expiration_validate_time: 3 + check_inputs_types_supported_time: 7 + tx_processing_time: 8 + check_keyimages_ws_ms_time: 5 + check_inputs_time: 7 + validate_alias_time: 9 + check_post_hf4_balance: 3 + properties: + tx_processing_time: + type: integer + check_inputs_types_supported_time: + type: integer + expiration_validate_time: + type: integer + validate_amount_time: + type: integer + validate_alias_time: + type: integer + check_keyimages_ws_ms_time: + type: integer + check_inputs_time: + type: integer + begin_tx_time: + type: integer + update_db_time: + type: integer + db_commit_time: + type: integer + check_post_hf4_balance: + type: integer + type: object + MaintainersInfoModel: + example: + mode: 126 + build_no: 503831554 + ver_revision: 190 + ver_major: 37 + ver_minor: 174 + properties: + ver_major: + maximum: 255 + minimum: 0 + type: integer + ver_minor: + maximum: 255 + minimum: 0 + type: integer + ver_revision: + maximum: 255 + minimum: 0 + type: integer + build_no: + maximum: 4294967295 + minimum: 0 + type: integer + mode: + maximum: 255 + minimum: 0 + type: integer + type: object + InfoModel: + example: + current_max_allowed_block_size: 7 + tx_count_in_last_block: 5 + transactions_cnt_per_day: + - 6 + - 6 + grey_peerlist_size: 3 + minimum_fee: 9 + pos_difficulty: pos_difficulty + block_reward: 3 + last_pos_timestamp: 2 + pos_sequence_factor: 6.704019297950036 + pos_block_ts_shift_vs_actual: 6 + current_network_hashrate_50: 8 + last_block_timestamp: 7 + pow_difficulty: 5 + alias_count: 4 + mi: + mode: 126 + build_no: 503831554 + ver_revision: 190 + ver_major: 37 + ver_minor: 174 + pos_allowed: true + last_pow_timestamp: 6 + is_hardfork_active: + - true + - true + height: 0 + tx_pool_size: 1 + performance_data: + tx_pool: + begin_tx_time: 0 + db_commit_time: 2 + validate_amount_time: 3 + update_db_time: 3 + expiration_validate_time: 3 + check_inputs_types_supported_time: 7 + tx_processing_time: 8 + check_keyimages_ws_ms_time: 5 + check_inputs_time: 7 + validate_alias_time: 9 + check_post_hf4_balance: 3 + tx_processing: + tx_process_inputs: 5 + tx_check_inputs_loop: 4 + tx_prapare_append: 4 + tx_check_inputs: 0 + tx_append: 3 + tx_check_exist: 6 + tx_check_inputs_loop_scan_outputkeys_loop_get_subitem: 8 + tx_mixin_count: 5 + tx_append_rl_wait: 0 + tx_check_inputs_loop_kimage_check: 8 + tx_check_inputs_loop_scan_outputkeys_loop_find_tx: 0 + tx_push_global_index: 4 + tx_add_one_tx: 9 + tx_check_inputs_loop_scan_outputkeys_get_item_size: 1 + tx_print_log: 8 + tx_check_inputs_prefix_hash: 8 + tx_append_is_expired: 2 + tx_check_inputs_loop_ch_in_val_sig: 9 + tx_check_inputs_loop_scan_outputkeys_loop_handle_output: 5 + tx_process_extra: 0 + tx_process_attachment: 7 + tx_check_inputs_loop_scan_outputkeys_loop: 9 + tx_store_db: 1 + tx_check_inputs_attachment_check: 6 + tx_check_inputs_loop_scan_outputkeys_relative_to_absolute: 3 + block_processing: + target_calculating_calc: 1 + pos_validate_ki_search: 4 + all_txs_insert_time_5: 3 + etc_stuff_6: 7 + target_calculating_enum_blocks: 4 + target_calculating_time_2: 7 + validate_miner_transaction_time: 4 + verify_multiple_zc_outs_range_proofs_time: 6 + raise_block_core_event: 3 + insert_time_4: 5 + pos_validate_get_out_keys_for_inputs: 7 + block_processing_time_1: 8 + block_processing_time_0: 4 + pos_validate_zvp: 9 + collect_rangeproofs_data_from_tx_time: 0 + longhash_calculating_time_3: 3 + db_stat_info: + write_tx_count: 4 + tx_count: 8 + map_size: 0 + net_time_delta_median: 6 + alt_blocks_count: 5 + incoming_connections_count: 2 + tx_count: 6 + outgoing_connections_count: 5 + transactions_volume_per_day: + - 1 + - 1 + current_blocks_median: 2 + expiration_median_timestamp: 7 + max_net_seen_height: 1 + current_network_hashrate_350: 9 + synchronized_connections_count: 7 + last_block_total_reward: 7 + default_fee: 9 + seconds_for_10_blocks: 6 + pow_sequence_factor: 3.353193347011243 + synchronization_start_height: 1 + last_block_hash: last_block_hash + white_peerlist_size: 9 + total_coins: total_coins + seconds_for_30_blocks: 3 + outs_stat: + key: 0 + offers_count: 0 + pos_diff_total_coins_rate: 0 + daemon_network_state: daemon_network_state + last_block_size: 6 + properties: + height: + type: integer + tx_count: + type: integer + tx_pool_size: + type: integer + alt_blocks_count: + type: integer + outgoing_connections_count: + type: integer + incoming_connections_count: + type: integer + synchronized_connections_count: + type: integer + white_peerlist_size: + type: integer + grey_peerlist_size: + type: integer + current_blocks_median: + type: integer + alias_count: + type: integer + current_max_allowed_block_size: + type: integer + daemon_network_state: + type: string + synchronization_start_height: + type: integer + max_net_seen_height: + type: integer + mi: + $ref: "#/components/schemas/MaintainersInfoModel" + pos_allowed: + type: boolean + pos_difficulty: + type: string + pow_difficulty: + type: integer + default_fee: + type: integer + minimum_fee: + type: integer + is_hardfork_active: + items: + type: boolean + type: array + net_time_delta_median: + format: int64 + type: integer + current_network_hashrate_50: + type: integer + current_network_hashrate_350: + type: integer + seconds_for_10_blocks: + type: integer + seconds_for_30_blocks: + type: integer + transactions_cnt_per_day: + items: + type: integer + type: array + transactions_volume_per_day: + items: + type: integer + type: array + last_pos_timestamp: + type: integer + last_pow_timestamp: + type: integer + total_coins: + type: string + last_block_size: + type: integer + tx_count_in_last_block: + type: integer + pos_sequence_factor: + format: double + type: number + pow_sequence_factor: + format: double + type: number + block_reward: + type: integer + last_block_total_reward: + type: integer + pos_diff_total_coins_rate: + type: integer + last_block_timestamp: + type: integer + last_block_hash: + type: string + pos_block_ts_shift_vs_actual: + format: int64 + type: integer + outs_stat: + additionalProperties: + type: integer + type: object + performance_data: + $ref: "#/components/schemas/PerformanceModel" + offers_count: + type: integer + expiration_median_timestamp: + type: integer + type: object + SubmitBlockResponseModel: + example: + status: status + properties: + status: + type: string + type: object + VersionModel: + example: + version_long: version_long + major: major + minor: minor + version: version + revision: revision + properties: + version: + type: string + version_long: + type: string + major: + type: string + minor: + type: string + revision: + type: string + type: object + TransactionOutputModel: + example: + amount: 5 + pub_keys: + - pub_keys + - pub_keys + is_spent: true + minimum_sigs: 2147483647 + global_index: 9 + properties: + amount: + type: integer + global_index: + type: integer + is_spent: + type: boolean + minimum_sigs: + maximum: 4294967295 + minimum: 0 + type: integer + pub_keys: + items: + type: string + type: array + type: object + TransactionInputModel: + example: + amount: 6 + kimage_or_ms_id: kimage_or_ms_id + htlc_origin: htlc_origin + global_indexes: + - 7 + - 7 + multisig_count: 503831554 + properties: + amount: + type: integer + global_indexes: + items: + type: integer + type: array + htlc_origin: + type: string + kimage_or_ms_id: + type: string + multisig_count: + maximum: 4294967295 + minimum: 0 + type: integer + type: object + PerformanceModel: + example: + tx_pool: + begin_tx_time: 0 + db_commit_time: 2 + validate_amount_time: 3 + update_db_time: 3 + expiration_validate_time: 3 + check_inputs_types_supported_time: 7 + tx_processing_time: 8 + check_keyimages_ws_ms_time: 5 + check_inputs_time: 7 + validate_alias_time: 9 + check_post_hf4_balance: 3 + tx_processing: + tx_process_inputs: 5 + tx_check_inputs_loop: 4 + tx_prapare_append: 4 + tx_check_inputs: 0 + tx_append: 3 + tx_check_exist: 6 + tx_check_inputs_loop_scan_outputkeys_loop_get_subitem: 8 + tx_mixin_count: 5 + tx_append_rl_wait: 0 + tx_check_inputs_loop_kimage_check: 8 + tx_check_inputs_loop_scan_outputkeys_loop_find_tx: 0 + tx_push_global_index: 4 + tx_add_one_tx: 9 + tx_check_inputs_loop_scan_outputkeys_get_item_size: 1 + tx_print_log: 8 + tx_check_inputs_prefix_hash: 8 + tx_append_is_expired: 2 + tx_check_inputs_loop_ch_in_val_sig: 9 + tx_check_inputs_loop_scan_outputkeys_loop_handle_output: 5 + tx_process_extra: 0 + tx_process_attachment: 7 + tx_check_inputs_loop_scan_outputkeys_loop: 9 + tx_store_db: 1 + tx_check_inputs_attachment_check: 6 + tx_check_inputs_loop_scan_outputkeys_relative_to_absolute: 3 + block_processing: + target_calculating_calc: 1 + pos_validate_ki_search: 4 + all_txs_insert_time_5: 3 + etc_stuff_6: 7 + target_calculating_enum_blocks: 4 + target_calculating_time_2: 7 + validate_miner_transaction_time: 4 + verify_multiple_zc_outs_range_proofs_time: 6 + raise_block_core_event: 3 + insert_time_4: 5 + pos_validate_get_out_keys_for_inputs: 7 + block_processing_time_1: 8 + block_processing_time_0: 4 + pos_validate_zvp: 9 + collect_rangeproofs_data_from_tx_time: 0 + longhash_calculating_time_3: 3 + db_stat_info: + write_tx_count: 4 + tx_count: 8 + map_size: 0 + properties: + block_processing: + $ref: "#/components/schemas/BlockProcessingPerformanceModel" + tx_processing: + $ref: "#/components/schemas/TxProcessingPerformanceModel" + tx_pool: + $ref: "#/components/schemas/TxPoolPerformanceModel" + db_stat_info: + $ref: "#/components/schemas/DbStatInfoModel" + type: object + TransactionExtraModel: + example: + details_view: details_view + type: type + short_view: short_view + properties: + type: + type: string + short_view: + type: string + details_view: + type: string + type: object + TxProcessingPerformanceModel: + example: + tx_process_inputs: 5 + tx_check_inputs_loop: 4 + tx_prapare_append: 4 + tx_check_inputs: 0 + tx_append: 3 + tx_check_exist: 6 + tx_check_inputs_loop_scan_outputkeys_loop_get_subitem: 8 + tx_mixin_count: 5 + tx_append_rl_wait: 0 + tx_check_inputs_loop_kimage_check: 8 + tx_check_inputs_loop_scan_outputkeys_loop_find_tx: 0 + tx_push_global_index: 4 + tx_add_one_tx: 9 + tx_check_inputs_loop_scan_outputkeys_get_item_size: 1 + tx_print_log: 8 + tx_check_inputs_prefix_hash: 8 + tx_append_is_expired: 2 + tx_check_inputs_loop_ch_in_val_sig: 9 + tx_check_inputs_loop_scan_outputkeys_loop_handle_output: 5 + tx_process_extra: 0 + tx_process_attachment: 7 + tx_check_inputs_loop_scan_outputkeys_loop: 9 + tx_store_db: 1 + tx_check_inputs_attachment_check: 6 + tx_check_inputs_loop_scan_outputkeys_relative_to_absolute: 3 + properties: + tx_check_inputs: + type: integer + tx_add_one_tx: + type: integer + tx_process_extra: + type: integer + tx_process_attachment: + type: integer + tx_process_inputs: + type: integer + tx_push_global_index: + type: integer + tx_check_exist: + type: integer + tx_print_log: + type: integer + tx_prapare_append: + type: integer + tx_append: + type: integer + tx_append_rl_wait: + type: integer + tx_append_is_expired: + type: integer + tx_store_db: + type: integer + tx_check_inputs_prefix_hash: + type: integer + tx_check_inputs_attachment_check: + type: integer + tx_check_inputs_loop: + type: integer + tx_check_inputs_loop_kimage_check: + type: integer + tx_check_inputs_loop_ch_in_val_sig: + type: integer + tx_check_inputs_loop_scan_outputkeys_get_item_size: + type: integer + tx_check_inputs_loop_scan_outputkeys_relative_to_absolute: + type: integer + tx_check_inputs_loop_scan_outputkeys_loop: + type: integer + tx_check_inputs_loop_scan_outputkeys_loop_get_subitem: + type: integer + tx_check_inputs_loop_scan_outputkeys_loop_find_tx: + type: integer + tx_check_inputs_loop_scan_outputkeys_loop_handle_output: + type: integer + tx_mixin_count: + type: integer + type: object + TxGenerationContextModel: + example: + amount_commitments: + - amount_commitments + - amount_commitments + real_zc_ins_asset_ids: + - real_zc_ins_asset_ids + - real_zc_ins_asset_ids + amount_commitments_sum: amount_commitments_sum + asset_ids: + - asset_ids + - asset_ids + tx_key_sec: tx_key_sec + real_in_asset_id_blinding_mask_x_amount_sum: real_in_asset_id_blinding_mask_x_amount_sum + pseudo_outs_blinded_asset_ids: + - pseudo_outs_blinded_asset_ids + - pseudo_outs_blinded_asset_ids + ao_commitment_in_outputs: true + ao_asset_id_pt: ao_asset_id_pt + zc_input_amounts: + - 6 + - 6 + pseudo_outs_plus_real_out_blinding_masks: + - pseudo_outs_plus_real_out_blinding_masks + - pseudo_outs_plus_real_out_blinding_masks + tx_pub_key_p: tx_pub_key_p + amounts: + - amounts + - amounts + pseudo_out_amount_blinding_masks_sum: pseudo_out_amount_blinding_masks_sum + ao_amount_blinding_mask: ao_amount_blinding_mask + amount_blinding_masks: + - amount_blinding_masks + - amount_blinding_masks + tx_key_pub: tx_key_pub + amount_blinding_masks_sum: amount_blinding_masks_sum + asset_id_blinding_mask_x_amount_sum: asset_id_blinding_mask_x_amount_sum + blinded_asset_ids: + - blinded_asset_ids + - blinded_asset_ids + asset_id_blinding_masks: + - asset_id_blinding_masks + - asset_id_blinding_masks + pseudo_out_amount_commitments_sum: pseudo_out_amount_commitments_sum + ao_asset_id: ao_asset_id + ao_amount_commitment: ao_amount_commitment + properties: + asset_ids: + items: + type: string + type: array + blinded_asset_ids: + items: + type: string + type: array + amount_commitments: + items: + type: string + type: array + asset_id_blinding_masks: + items: + type: string + type: array + amounts: + items: + type: string + type: array + amount_blinding_masks: + items: + type: string + type: array + pseudo_outs_blinded_asset_ids: + items: + type: string + type: array + pseudo_outs_plus_real_out_blinding_masks: + items: + type: string + type: array + real_zc_ins_asset_ids: + items: + type: string + type: array + zc_input_amounts: + items: + type: integer + type: array + pseudo_out_amount_commitments_sum: + type: string + pseudo_out_amount_blinding_masks_sum: + type: string + real_in_asset_id_blinding_mask_x_amount_sum: + type: string + amount_commitments_sum: + type: string + amount_blinding_masks_sum: + type: string + asset_id_blinding_mask_x_amount_sum: + type: string + ao_asset_id: + type: string + ao_asset_id_pt: + type: string + ao_amount_commitment: + type: string + ao_amount_blinding_mask: + type: string + ao_commitment_in_outputs: + type: boolean + tx_key_pub: + type: string + tx_key_sec: + type: string + tx_pub_key_p: + type: string + type: object + HeightModel: + example: + height: 0 + properties: + height: + type: integer + type: object + BlockTemplateModel: + example: + difficulty: difficulty + seed: seed + block_reward_without_fee: 1 + block_reward: 5 + prev_hash: prev_hash + miner_tx_tgc: + amount_commitments: + - amount_commitments + - amount_commitments + real_zc_ins_asset_ids: + - real_zc_ins_asset_ids + - real_zc_ins_asset_ids + amount_commitments_sum: amount_commitments_sum + asset_ids: + - asset_ids + - asset_ids + tx_key_sec: tx_key_sec + real_in_asset_id_blinding_mask_x_amount_sum: real_in_asset_id_blinding_mask_x_amount_sum + pseudo_outs_blinded_asset_ids: + - pseudo_outs_blinded_asset_ids + - pseudo_outs_blinded_asset_ids + ao_commitment_in_outputs: true + ao_asset_id_pt: ao_asset_id_pt + zc_input_amounts: + - 6 + - 6 + pseudo_outs_plus_real_out_blinding_masks: + - pseudo_outs_plus_real_out_blinding_masks + - pseudo_outs_plus_real_out_blinding_masks + tx_pub_key_p: tx_pub_key_p + amounts: + - amounts + - amounts + pseudo_out_amount_blinding_masks_sum: pseudo_out_amount_blinding_masks_sum + ao_amount_blinding_mask: ao_amount_blinding_mask + amount_blinding_masks: + - amount_blinding_masks + - amount_blinding_masks + tx_key_pub: tx_key_pub + amount_blinding_masks_sum: amount_blinding_masks_sum + asset_id_blinding_mask_x_amount_sum: asset_id_blinding_mask_x_amount_sum + blinded_asset_ids: + - blinded_asset_ids + - blinded_asset_ids + asset_id_blinding_masks: + - asset_id_blinding_masks + - asset_id_blinding_masks + pseudo_out_amount_commitments_sum: pseudo_out_amount_commitments_sum + ao_asset_id: ao_asset_id + ao_amount_commitment: ao_amount_commitment + blocktemplate_blob: blocktemplate_blob + height: 0 + txs_fee: 5 + properties: + blocktemplate_blob: + type: string + difficulty: + type: string + height: + type: integer + miner_tx_tgc: + $ref: "#/components/schemas/TxGenerationContextModel" + block_reward_without_fee: + type: integer + block_reward: + type: integer + txs_fee: + type: integer + prev_hash: + type: string + seed: + type: string + type: object + TransactionAttachmentModel: + example: + details_view: details_view + type: type + short_view: short_view + properties: + type: + type: string + short_view: + type: string + details_view: + type: string + type: object + BlockDetailsModel: + example: + miner_text_info: miner_text_info + block_tself_size: 5 + penalty: 7 + cumulative_diff_precise: cumulative_diff_precise + type: 2147483647 + block_cumulative_size: 1 + total_txs_size: 7 + total_fee: 4 + transactions_details: + - amount: 1 + attachments: + - details_view: details_view + type: type + short_view: short_view + - details_view: details_view + type: type + short_view: short_view + object_in_json: object_in_json + fee: 1 + ins: + - amount: 6 + kimage_or_ms_id: kimage_or_ms_id + htlc_origin: htlc_origin + global_indexes: + - 7 + - 7 + multisig_count: 503831554 + - amount: 6 + kimage_or_ms_id: kimage_or_ms_id + htlc_origin: htlc_origin + global_indexes: + - 7 + - 7 + multisig_count: 503831554 + pub_key: pub_key + outs: + - amount: 5 + pub_keys: + - pub_keys + - pub_keys + is_spent: true + minimum_sigs: 2147483647 + global_index: 9 + - amount: 5 + pub_keys: + - pub_keys + - pub_keys + is_spent: true + minimum_sigs: 2147483647 + global_index: 9 + blob: blob + blob_size: 1 + keeper_block: 4 + extra: + - details_view: details_view + type: type + short_view: short_view + - details_view: details_view + type: type + short_view: short_view + id: id + timestamp: 6 + - amount: 1 + attachments: + - details_view: details_view + type: type + short_view: short_view + - details_view: details_view + type: type + short_view: short_view + object_in_json: object_in_json + fee: 1 + ins: + - amount: 6 + kimage_or_ms_id: kimage_or_ms_id + htlc_origin: htlc_origin + global_indexes: + - 7 + - 7 + multisig_count: 503831554 + - amount: 6 + kimage_or_ms_id: kimage_or_ms_id + htlc_origin: htlc_origin + global_indexes: + - 7 + - 7 + multisig_count: 503831554 + pub_key: pub_key + outs: + - amount: 5 + pub_keys: + - pub_keys + - pub_keys + is_spent: true + minimum_sigs: 2147483647 + global_index: 9 + - amount: 5 + pub_keys: + - pub_keys + - pub_keys + is_spent: true + minimum_sigs: 2147483647 + global_index: 9 + blob: blob + blob_size: 1 + keeper_block: 4 + extra: + - details_view: details_view + type: type + short_view: short_view + - details_view: details_view + type: type + short_view: short_view + id: id + timestamp: 6 + id: id + height: 2 + timestamp: 2 + pow_seed: pow_seed + object_in_json: object_in_json + base_reward: 6 + summary_reward: 9 + cumulative_diff_adjusted: cumulative_diff_adjusted + already_generated_coins: already_generated_coins + prev_id: prev_id + actual_timestamp: 0 + difficulty: difficulty + is_orphan: true + this_block_fee_median: 3 + blob: blob + effective_fee_median: 5 + properties: + actual_timestamp: + type: integer + already_generated_coins: + type: string + base_reward: + type: integer + blob: + type: string + block_cumulative_size: + type: integer + block_tself_size: + type: integer + cumulative_diff_adjusted: + type: string + cumulative_diff_precise: + type: string + difficulty: + type: string + effective_fee_median: + type: integer + height: + type: integer + id: + type: string + is_orphan: + type: boolean + miner_text_info: + type: string + object_in_json: + type: string + penalty: + type: integer + pow_seed: + type: string + prev_id: + type: string + summary_reward: + type: integer + this_block_fee_median: + type: integer + timestamp: + type: integer + total_fee: + type: integer + total_txs_size: + type: integer + transactions_details: + items: + $ref: "#/components/schemas/TransactionDetailsModel" + type: array + type: + maximum: 4294967295 + minimum: 0 + type: integer + type: object + PosEntryModel: + example: + amount: 0 + stake_unlock_time: 5 + g_index: 6 + keyimage: keyimage + tx_out_index: 5 + block_timestamp: 1 + wallet_index: 2 + tx_id: tx_id + properties: + amount: + type: integer + g_index: + type: integer + keyimage: + type: string + block_timestamp: + type: integer + stake_unlock_time: + type: integer + tx_id: + type: string + tx_out_index: + type: integer + wallet_index: + type: integer + type: object + TransactionDetailsModel: + example: + amount: 1 + attachments: + - details_view: details_view + type: type + short_view: short_view + - details_view: details_view + type: type + short_view: short_view + object_in_json: object_in_json + fee: 1 + ins: + - amount: 6 + kimage_or_ms_id: kimage_or_ms_id + htlc_origin: htlc_origin + global_indexes: + - 7 + - 7 + multisig_count: 503831554 + - amount: 6 + kimage_or_ms_id: kimage_or_ms_id + htlc_origin: htlc_origin + global_indexes: + - 7 + - 7 + multisig_count: 503831554 + pub_key: pub_key + outs: + - amount: 5 + pub_keys: + - pub_keys + - pub_keys + is_spent: true + minimum_sigs: 2147483647 + global_index: 9 + - amount: 5 + pub_keys: + - pub_keys + - pub_keys + is_spent: true + minimum_sigs: 2147483647 + global_index: 9 + blob: blob + blob_size: 1 + keeper_block: 4 + extra: + - details_view: details_view + type: type + short_view: short_view + - details_view: details_view + type: type + short_view: short_view + id: id + timestamp: 6 + properties: + amount: + type: integer + attachments: + items: + $ref: "#/components/schemas/TransactionAttachmentModel" + type: array + blob: + type: string + blob_size: + type: integer + extra: + items: + $ref: "#/components/schemas/TransactionExtraModel" + type: array + fee: + type: integer + id: + type: string + ins: + items: + $ref: "#/components/schemas/TransactionInputModel" + type: array + keeper_block: + format: int64 + type: integer + object_in_json: + type: string + outs: + items: + $ref: "#/components/schemas/TransactionOutputModel" + type: array + pub_key: + type: string + timestamp: + type: integer + type: object + BlockProcessingPerformanceModel: + example: + target_calculating_calc: 1 + pos_validate_ki_search: 4 + all_txs_insert_time_5: 3 + etc_stuff_6: 7 + target_calculating_enum_blocks: 4 + target_calculating_time_2: 7 + validate_miner_transaction_time: 4 + verify_multiple_zc_outs_range_proofs_time: 6 + raise_block_core_event: 3 + insert_time_4: 5 + pos_validate_get_out_keys_for_inputs: 7 + block_processing_time_1: 8 + block_processing_time_0: 4 + pos_validate_zvp: 9 + collect_rangeproofs_data_from_tx_time: 0 + longhash_calculating_time_3: 3 + properties: + block_processing_time_0: + type: integer + block_processing_time_1: + type: integer + target_calculating_time_2: + type: integer + longhash_calculating_time_3: + type: integer + all_txs_insert_time_5: + type: integer + etc_stuff_6: + type: integer + insert_time_4: + type: integer + raise_block_core_event: + type: integer + validate_miner_transaction_time: + type: integer + collect_rangeproofs_data_from_tx_time: + type: integer + verify_multiple_zc_outs_range_proofs_time: + type: integer + target_calculating_enum_blocks: + type: integer + target_calculating_calc: + type: integer + pos_validate_ki_search: + type: integer + pos_validate_get_out_keys_for_inputs: + type: integer + pos_validate_zvp: + type: integer + type: object + BlockTemplateRequestModel: + example: + miner_address: miner_address + pos_block: true + ex_nonce: ex_nonce + pe: + amount: 0 + stake_unlock_time: 5 + g_index: 6 + keyimage: keyimage + tx_out_index: 5 + block_timestamp: 1 + wallet_index: 2 + tx_id: tx_id + ignore_pow_ts_check: true + stakeholder_address: stakeholder_address + explicit_txs: + - explicit_txs + - explicit_txs + properties: + miner_address: + type: string + stakeholder_address: + type: string + ex_nonce: + type: string + pos_block: + type: boolean + ignore_pow_ts_check: + type: boolean + pe: + $ref: "#/components/schemas/PosEntryModel" + explicit_txs: + items: + type: string + type: array + type: object + SubmitBlockRequestModel: + example: + block_blob: block_blob + properties: + block_blob: + type: string + type: object + diff --git a/utils/sdk/client/java/build.gradle b/utils/sdk/client/java/build.gradle new file mode 100644 index 00000000..557d461b --- /dev/null +++ b/utils/sdk/client/java/build.gradle @@ -0,0 +1,166 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'letheanVPN' +version = '6.0.1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'lthn' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' + implementation 'org.openapitools:jackson-databind-nullable:0.2.7' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/utils/sdk/client/java/build.sbt b/utils/sdk/client/java/build.sbt new file mode 100644 index 00000000..855a4ddf --- /dev/null +++ b/utils/sdk/client/java/build.sbt @@ -0,0 +1,27 @@ +lazy val root = (project in file(".")). + settings( + organization := "letheanVPN", + name := "lthn", + version := "6.0.1", + scalaVersion := "2.11.12", + scalacOptions ++= Seq("-feature"), + compile / javacOptions ++= Seq("-Xlint:deprecation"), + Compile / packageDoc / publishArtifact := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.18.0", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", + "org.openapitools" % "jackson-databind-nullable" % "0.2.7", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/utils/sdk/client/java/docs/BlockApi.md b/utils/sdk/client/java/docs/BlockApi.md new file mode 100644 index 00000000..872dee62 --- /dev/null +++ b/utils/sdk/client/java/docs/BlockApi.md @@ -0,0 +1,313 @@ +# BlockApi + +All URIs are relative to *http://127.0.0.1:36943* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createBlockTemplate**](BlockApi.md#createBlockTemplate) | **POST** /block/template | Create a block template for mining | +| [**getBlock**](BlockApi.md#getBlock) | **GET** /block/{identifier} | Get a block by its hash or height (ID) | +| [**getBlocks**](BlockApi.md#getBlocks) | **GET** /block | Get one or more blocks, with optional pagination. | +| [**getHeight**](BlockApi.md#getHeight) | **GET** /block/height | Get the current blockchain height | +| [**submitBlock**](BlockApi.md#submitBlock) | **POST** /block/submit | Submit a new block to the network | + + + +# **createBlockTemplate** +> BlockTemplateModel createBlockTemplate(blockTemplateRequestModel) + +Create a block template for mining + +### Example +```java +// Import classes: +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.Configuration; +import invalidPackageName.models.*; +import lthn.BlockApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://127.0.0.1:36943"); + + BlockApi apiInstance = new BlockApi(defaultClient); + BlockTemplateRequestModel blockTemplateRequestModel = new BlockTemplateRequestModel(); // BlockTemplateRequestModel | + try { + BlockTemplateModel result = apiInstance.createBlockTemplate(blockTemplateRequestModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BlockApi#createBlockTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **blockTemplateRequestModel** | [**BlockTemplateRequestModel**](BlockTemplateRequestModel.md)| | | + +### Return type + +[**BlockTemplateModel**](BlockTemplateModel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **500** | text/plain | - | +| **400** | text/plain | - | +| **200** | OK | - | + + +# **getBlock** +> BlockDetailsModel getBlock(identifier) + +Get a block by its hash or height (ID) + +### Example +```java +// Import classes: +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.Configuration; +import invalidPackageName.models.*; +import lthn.BlockApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://127.0.0.1:36943"); + + BlockApi apiInstance = new BlockApi(defaultClient); + String identifier = "identifier_example"; // String | The hash (hex string) or height (integer) of the block to retrieve. + try { + BlockDetailsModel result = apiInstance.getBlock(identifier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BlockApi#getBlock"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **identifier** | **String**| The hash (hex string) or height (integer) of the block to retrieve. | | + +### Return type + +[**BlockDetailsModel**](BlockDetailsModel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **404** | text/plain | - | +| **400** | text/plain | - | +| **200** | OK | - | + + +# **getBlocks** +> List<BlockDetailsModel> getBlocks() + +Get one or more blocks, with optional pagination. + +### Example +```java +// Import classes: +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.Configuration; +import invalidPackageName.models.*; +import lthn.BlockApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://127.0.0.1:36943"); + + BlockApi apiInstance = new BlockApi(defaultClient); + try { + List result = apiInstance.getBlocks(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BlockApi#getBlocks"); + 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 + +[**List<BlockDetailsModel>**](BlockDetailsModel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **404** | text/plain | - | +| **400** | text/plain | - | +| **200** | A list of block objects. | - | + + +# **getHeight** +> HeightModel getHeight() + +Get the current blockchain height + +### Example +```java +// Import classes: +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.Configuration; +import invalidPackageName.models.*; +import lthn.BlockApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://127.0.0.1:36943"); + + BlockApi apiInstance = new BlockApi(defaultClient); + try { + HeightModel result = apiInstance.getHeight(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BlockApi#getHeight"); + 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 + +[**HeightModel**](HeightModel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **submitBlock** +> SubmitBlockResponseModel submitBlock(submitBlockRequestModel) + +Submit a new block to the network + +### Example +```java +// Import classes: +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.Configuration; +import invalidPackageName.models.*; +import lthn.BlockApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://127.0.0.1:36943"); + + BlockApi apiInstance = new BlockApi(defaultClient); + SubmitBlockRequestModel submitBlockRequestModel = new SubmitBlockRequestModel(); // SubmitBlockRequestModel | + try { + SubmitBlockResponseModel result = apiInstance.submitBlock(submitBlockRequestModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BlockApi#submitBlock"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **submitBlockRequestModel** | [**SubmitBlockRequestModel**](SubmitBlockRequestModel.md)| | | + +### Return type + +[**SubmitBlockResponseModel**](SubmitBlockResponseModel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **406** | text/plain | - | +| **400** | text/plain | - | +| **200** | OK | - | + diff --git a/utils/sdk/client/java/docs/BlockDetailsModel.md b/utils/sdk/client/java/docs/BlockDetailsModel.md new file mode 100644 index 00000000..80e767f1 --- /dev/null +++ b/utils/sdk/client/java/docs/BlockDetailsModel.md @@ -0,0 +1,37 @@ + + +# BlockDetailsModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**actualTimestamp** | **Integer** | | [optional] | +|**alreadyGeneratedCoins** | **String** | | [optional] | +|**baseReward** | **Integer** | | [optional] | +|**blob** | **String** | | [optional] | +|**blockCumulativeSize** | **Integer** | | [optional] | +|**blockTselfSize** | **Integer** | | [optional] | +|**cumulativeDiffAdjusted** | **String** | | [optional] | +|**cumulativeDiffPrecise** | **String** | | [optional] | +|**difficulty** | **String** | | [optional] | +|**effectiveFeeMedian** | **Integer** | | [optional] | +|**height** | **Integer** | | [optional] | +|**id** | **String** | | [optional] | +|**isOrphan** | **Boolean** | | [optional] | +|**minerTextInfo** | **String** | | [optional] | +|**objectInJson** | **String** | | [optional] | +|**penalty** | **Integer** | | [optional] | +|**powSeed** | **String** | | [optional] | +|**prevId** | **String** | | [optional] | +|**summaryReward** | **Integer** | | [optional] | +|**thisBlockFeeMedian** | **Integer** | | [optional] | +|**timestamp** | **Integer** | | [optional] | +|**totalFee** | **Integer** | | [optional] | +|**totalTxsSize** | **Integer** | | [optional] | +|**transactionsDetails** | [**List<TransactionDetailsModel>**](TransactionDetailsModel.md) | | [optional] | +|**type** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/BlockProcessingPerformanceModel.md b/utils/sdk/client/java/docs/BlockProcessingPerformanceModel.md new file mode 100644 index 00000000..21fa6280 --- /dev/null +++ b/utils/sdk/client/java/docs/BlockProcessingPerformanceModel.md @@ -0,0 +1,28 @@ + + +# BlockProcessingPerformanceModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**blockProcessingTime0** | **Integer** | | [optional] | +|**blockProcessingTime1** | **Integer** | | [optional] | +|**targetCalculatingTime2** | **Integer** | | [optional] | +|**longhashCalculatingTime3** | **Integer** | | [optional] | +|**allTxsInsertTime5** | **Integer** | | [optional] | +|**etcStuff6** | **Integer** | | [optional] | +|**insertTime4** | **Integer** | | [optional] | +|**raiseBlockCoreEvent** | **Integer** | | [optional] | +|**validateMinerTransactionTime** | **Integer** | | [optional] | +|**collectRangeproofsDataFromTxTime** | **Integer** | | [optional] | +|**verifyMultipleZcOutsRangeProofsTime** | **Integer** | | [optional] | +|**targetCalculatingEnumBlocks** | **Integer** | | [optional] | +|**targetCalculatingCalc** | **Integer** | | [optional] | +|**posValidateKiSearch** | **Integer** | | [optional] | +|**posValidateGetOutKeysForInputs** | **Integer** | | [optional] | +|**posValidateZvp** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/BlockTemplateModel.md b/utils/sdk/client/java/docs/BlockTemplateModel.md new file mode 100644 index 00000000..0ec805f9 --- /dev/null +++ b/utils/sdk/client/java/docs/BlockTemplateModel.md @@ -0,0 +1,21 @@ + + +# BlockTemplateModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**blocktemplateBlob** | **String** | | [optional] | +|**difficulty** | **String** | | [optional] | +|**height** | **Integer** | | [optional] | +|**minerTxTgc** | [**TxGenerationContextModel**](TxGenerationContextModel.md) | | [optional] | +|**blockRewardWithoutFee** | **Integer** | | [optional] | +|**blockReward** | **Integer** | | [optional] | +|**txsFee** | **Integer** | | [optional] | +|**prevHash** | **String** | | [optional] | +|**seed** | **String** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/BlockTemplateRequestModel.md b/utils/sdk/client/java/docs/BlockTemplateRequestModel.md new file mode 100644 index 00000000..6b65bb82 --- /dev/null +++ b/utils/sdk/client/java/docs/BlockTemplateRequestModel.md @@ -0,0 +1,19 @@ + + +# BlockTemplateRequestModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**minerAddress** | **String** | | [optional] | +|**stakeholderAddress** | **String** | | [optional] | +|**exNonce** | **String** | | [optional] | +|**posBlock** | **Boolean** | | [optional] | +|**ignorePowTsCheck** | **Boolean** | | [optional] | +|**pe** | [**PosEntryModel**](PosEntryModel.md) | | [optional] | +|**explicitTxs** | **List<String>** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/DbStatInfoModel.md b/utils/sdk/client/java/docs/DbStatInfoModel.md new file mode 100644 index 00000000..2e860e2c --- /dev/null +++ b/utils/sdk/client/java/docs/DbStatInfoModel.md @@ -0,0 +1,15 @@ + + +# DbStatInfoModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**txCount** | **Integer** | | [optional] | +|**writeTxCount** | **Integer** | | [optional] | +|**mapSize** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/HeightModel.md b/utils/sdk/client/java/docs/HeightModel.md new file mode 100644 index 00000000..1080f098 --- /dev/null +++ b/utils/sdk/client/java/docs/HeightModel.md @@ -0,0 +1,13 @@ + + +# HeightModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**height** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/InfoApi.md b/utils/sdk/client/java/docs/InfoApi.md new file mode 100644 index 00000000..9049b330 --- /dev/null +++ b/utils/sdk/client/java/docs/InfoApi.md @@ -0,0 +1,128 @@ +# InfoApi + +All URIs are relative to *http://127.0.0.1:36943* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getInfo**](InfoApi.md#getInfo) | **GET** /info | Get detailed information about the blockchain and daemon state | +| [**version**](InfoApi.md#version) | **GET** /info/version | Get API version | + + + +# **getInfo** +> InfoModel getInfo(flags) + +Get detailed information about the blockchain and daemon state + +### Example +```java +// Import classes: +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.Configuration; +import invalidPackageName.models.*; +import lthn.InfoApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://127.0.0.1:36943"); + + InfoApi apiInstance = new InfoApi(defaultClient); + String flags = "flags_example"; // String | Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. + try { + InfoModel result = apiInstance.getInfo(flags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InfoApi#getInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **flags** | **String**| Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. | [optional] | + +### Return type + +[**InfoModel**](InfoModel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **version** +> VersionModel version() + +Get API version + +Returns the current version of the API. + +### Example +```java +// Import classes: +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.Configuration; +import invalidPackageName.models.*; +import lthn.InfoApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://127.0.0.1:36943"); + + InfoApi apiInstance = new InfoApi(defaultClient); + try { + VersionModel result = apiInstance.version(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InfoApi#version"); + 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 + +[**VersionModel**](VersionModel.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + diff --git a/utils/sdk/client/java/docs/InfoModel.md b/utils/sdk/client/java/docs/InfoModel.md new file mode 100644 index 00000000..438a5fee --- /dev/null +++ b/utils/sdk/client/java/docs/InfoModel.md @@ -0,0 +1,58 @@ + + +# InfoModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**height** | **Integer** | | [optional] | +|**txCount** | **Integer** | | [optional] | +|**txPoolSize** | **Integer** | | [optional] | +|**altBlocksCount** | **Integer** | | [optional] | +|**outgoingConnectionsCount** | **Integer** | | [optional] | +|**incomingConnectionsCount** | **Integer** | | [optional] | +|**synchronizedConnectionsCount** | **Integer** | | [optional] | +|**whitePeerlistSize** | **Integer** | | [optional] | +|**greyPeerlistSize** | **Integer** | | [optional] | +|**currentBlocksMedian** | **Integer** | | [optional] | +|**aliasCount** | **Integer** | | [optional] | +|**currentMaxAllowedBlockSize** | **Integer** | | [optional] | +|**daemonNetworkState** | **String** | | [optional] | +|**synchronizationStartHeight** | **Integer** | | [optional] | +|**maxNetSeenHeight** | **Integer** | | [optional] | +|**mi** | [**MaintainersInfoModel**](MaintainersInfoModel.md) | | [optional] | +|**posAllowed** | **Boolean** | | [optional] | +|**posDifficulty** | **String** | | [optional] | +|**powDifficulty** | **Integer** | | [optional] | +|**defaultFee** | **Integer** | | [optional] | +|**minimumFee** | **Integer** | | [optional] | +|**isHardforkActive** | **List<Boolean>** | | [optional] | +|**netTimeDeltaMedian** | **Long** | | [optional] | +|**currentNetworkHashrate50** | **Integer** | | [optional] | +|**currentNetworkHashrate350** | **Integer** | | [optional] | +|**secondsFor10Blocks** | **Integer** | | [optional] | +|**secondsFor30Blocks** | **Integer** | | [optional] | +|**transactionsCntPerDay** | **List<Integer>** | | [optional] | +|**transactionsVolumePerDay** | **List<Integer>** | | [optional] | +|**lastPosTimestamp** | **Integer** | | [optional] | +|**lastPowTimestamp** | **Integer** | | [optional] | +|**totalCoins** | **String** | | [optional] | +|**lastBlockSize** | **Integer** | | [optional] | +|**txCountInLastBlock** | **Integer** | | [optional] | +|**posSequenceFactor** | **Double** | | [optional] | +|**powSequenceFactor** | **Double** | | [optional] | +|**blockReward** | **Integer** | | [optional] | +|**lastBlockTotalReward** | **Integer** | | [optional] | +|**posDiffTotalCoinsRate** | **Integer** | | [optional] | +|**lastBlockTimestamp** | **Integer** | | [optional] | +|**lastBlockHash** | **String** | | [optional] | +|**posBlockTsShiftVsActual** | **Long** | | [optional] | +|**outsStat** | **Map<String, Integer>** | | [optional] | +|**performanceData** | [**PerformanceModel**](PerformanceModel.md) | | [optional] | +|**offersCount** | **Integer** | | [optional] | +|**expirationMedianTimestamp** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/MaintainersInfoModel.md b/utils/sdk/client/java/docs/MaintainersInfoModel.md new file mode 100644 index 00000000..78b6efb3 --- /dev/null +++ b/utils/sdk/client/java/docs/MaintainersInfoModel.md @@ -0,0 +1,17 @@ + + +# MaintainersInfoModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**verMajor** | **Integer** | | [optional] | +|**verMinor** | **Integer** | | [optional] | +|**verRevision** | **Integer** | | [optional] | +|**buildNo** | **Integer** | | [optional] | +|**mode** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/PerformanceModel.md b/utils/sdk/client/java/docs/PerformanceModel.md new file mode 100644 index 00000000..caf860bc --- /dev/null +++ b/utils/sdk/client/java/docs/PerformanceModel.md @@ -0,0 +1,16 @@ + + +# PerformanceModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**blockProcessing** | [**BlockProcessingPerformanceModel**](BlockProcessingPerformanceModel.md) | | [optional] | +|**txProcessing** | [**TxProcessingPerformanceModel**](TxProcessingPerformanceModel.md) | | [optional] | +|**txPool** | [**TxPoolPerformanceModel**](TxPoolPerformanceModel.md) | | [optional] | +|**dbStatInfo** | [**DbStatInfoModel**](DbStatInfoModel.md) | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/PosEntryModel.md b/utils/sdk/client/java/docs/PosEntryModel.md new file mode 100644 index 00000000..be65be6c --- /dev/null +++ b/utils/sdk/client/java/docs/PosEntryModel.md @@ -0,0 +1,20 @@ + + +# PosEntryModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**amount** | **Integer** | | [optional] | +|**gIndex** | **Integer** | | [optional] | +|**keyimage** | **String** | | [optional] | +|**blockTimestamp** | **Integer** | | [optional] | +|**stakeUnlockTime** | **Integer** | | [optional] | +|**txId** | **String** | | [optional] | +|**txOutIndex** | **Integer** | | [optional] | +|**walletIndex** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/SubmitBlockRequestModel.md b/utils/sdk/client/java/docs/SubmitBlockRequestModel.md new file mode 100644 index 00000000..6a8854e2 --- /dev/null +++ b/utils/sdk/client/java/docs/SubmitBlockRequestModel.md @@ -0,0 +1,13 @@ + + +# SubmitBlockRequestModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**blockBlob** | **String** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/SubmitBlockResponseModel.md b/utils/sdk/client/java/docs/SubmitBlockResponseModel.md new file mode 100644 index 00000000..d52c5a0d --- /dev/null +++ b/utils/sdk/client/java/docs/SubmitBlockResponseModel.md @@ -0,0 +1,13 @@ + + +# SubmitBlockResponseModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **String** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TransactionAttachmentModel.md b/utils/sdk/client/java/docs/TransactionAttachmentModel.md new file mode 100644 index 00000000..63418cff --- /dev/null +++ b/utils/sdk/client/java/docs/TransactionAttachmentModel.md @@ -0,0 +1,15 @@ + + +# TransactionAttachmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | [optional] | +|**shortView** | **String** | | [optional] | +|**detailsView** | **String** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TransactionDetailsModel.md b/utils/sdk/client/java/docs/TransactionDetailsModel.md new file mode 100644 index 00000000..e98185b9 --- /dev/null +++ b/utils/sdk/client/java/docs/TransactionDetailsModel.md @@ -0,0 +1,25 @@ + + +# TransactionDetailsModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**amount** | **Integer** | | [optional] | +|**attachments** | [**List<TransactionAttachmentModel>**](TransactionAttachmentModel.md) | | [optional] | +|**blob** | **String** | | [optional] | +|**blobSize** | **Integer** | | [optional] | +|**extra** | [**List<TransactionExtraModel>**](TransactionExtraModel.md) | | [optional] | +|**fee** | **Integer** | | [optional] | +|**id** | **String** | | [optional] | +|**ins** | [**List<TransactionInputModel>**](TransactionInputModel.md) | | [optional] | +|**keeperBlock** | **Long** | | [optional] | +|**objectInJson** | **String** | | [optional] | +|**outs** | [**List<TransactionOutputModel>**](TransactionOutputModel.md) | | [optional] | +|**pubKey** | **String** | | [optional] | +|**timestamp** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TransactionExtraModel.md b/utils/sdk/client/java/docs/TransactionExtraModel.md new file mode 100644 index 00000000..423f278c --- /dev/null +++ b/utils/sdk/client/java/docs/TransactionExtraModel.md @@ -0,0 +1,15 @@ + + +# TransactionExtraModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | [optional] | +|**shortView** | **String** | | [optional] | +|**detailsView** | **String** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TransactionInputModel.md b/utils/sdk/client/java/docs/TransactionInputModel.md new file mode 100644 index 00000000..9b626d04 --- /dev/null +++ b/utils/sdk/client/java/docs/TransactionInputModel.md @@ -0,0 +1,17 @@ + + +# TransactionInputModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**amount** | **Integer** | | [optional] | +|**globalIndexes** | **List<Integer>** | | [optional] | +|**htlcOrigin** | **String** | | [optional] | +|**kimageOrMsId** | **String** | | [optional] | +|**multisigCount** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TransactionOutputModel.md b/utils/sdk/client/java/docs/TransactionOutputModel.md new file mode 100644 index 00000000..a1826cb0 --- /dev/null +++ b/utils/sdk/client/java/docs/TransactionOutputModel.md @@ -0,0 +1,17 @@ + + +# TransactionOutputModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**amount** | **Integer** | | [optional] | +|**globalIndex** | **Integer** | | [optional] | +|**isSpent** | **Boolean** | | [optional] | +|**minimumSigs** | **Integer** | | [optional] | +|**pubKeys** | **List<String>** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TxGenerationContextModel.md b/utils/sdk/client/java/docs/TxGenerationContextModel.md new file mode 100644 index 00000000..cc5557da --- /dev/null +++ b/utils/sdk/client/java/docs/TxGenerationContextModel.md @@ -0,0 +1,36 @@ + + +# TxGenerationContextModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**assetIds** | **List<String>** | | [optional] | +|**blindedAssetIds** | **List<String>** | | [optional] | +|**amountCommitments** | **List<String>** | | [optional] | +|**assetIdBlindingMasks** | **List<String>** | | [optional] | +|**amounts** | **List<String>** | | [optional] | +|**amountBlindingMasks** | **List<String>** | | [optional] | +|**pseudoOutsBlindedAssetIds** | **List<String>** | | [optional] | +|**pseudoOutsPlusRealOutBlindingMasks** | **List<String>** | | [optional] | +|**realZcInsAssetIds** | **List<String>** | | [optional] | +|**zcInputAmounts** | **List<Integer>** | | [optional] | +|**pseudoOutAmountCommitmentsSum** | **String** | | [optional] | +|**pseudoOutAmountBlindingMasksSum** | **String** | | [optional] | +|**realInAssetIdBlindingMaskXAmountSum** | **String** | | [optional] | +|**amountCommitmentsSum** | **String** | | [optional] | +|**amountBlindingMasksSum** | **String** | | [optional] | +|**assetIdBlindingMaskXAmountSum** | **String** | | [optional] | +|**aoAssetId** | **String** | | [optional] | +|**aoAssetIdPt** | **String** | | [optional] | +|**aoAmountCommitment** | **String** | | [optional] | +|**aoAmountBlindingMask** | **String** | | [optional] | +|**aoCommitmentInOutputs** | **Boolean** | | [optional] | +|**txKeyPub** | **String** | | [optional] | +|**txKeySec** | **String** | | [optional] | +|**txPubKeyP** | **String** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TxPoolPerformanceModel.md b/utils/sdk/client/java/docs/TxPoolPerformanceModel.md new file mode 100644 index 00000000..5a497625 --- /dev/null +++ b/utils/sdk/client/java/docs/TxPoolPerformanceModel.md @@ -0,0 +1,23 @@ + + +# TxPoolPerformanceModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**txProcessingTime** | **Integer** | | [optional] | +|**checkInputsTypesSupportedTime** | **Integer** | | [optional] | +|**expirationValidateTime** | **Integer** | | [optional] | +|**validateAmountTime** | **Integer** | | [optional] | +|**validateAliasTime** | **Integer** | | [optional] | +|**checkKeyimagesWsMsTime** | **Integer** | | [optional] | +|**checkInputsTime** | **Integer** | | [optional] | +|**beginTxTime** | **Integer** | | [optional] | +|**updateDbTime** | **Integer** | | [optional] | +|**dbCommitTime** | **Integer** | | [optional] | +|**checkPostHf4Balance** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/TxProcessingPerformanceModel.md b/utils/sdk/client/java/docs/TxProcessingPerformanceModel.md new file mode 100644 index 00000000..b562d1c3 --- /dev/null +++ b/utils/sdk/client/java/docs/TxProcessingPerformanceModel.md @@ -0,0 +1,37 @@ + + +# TxProcessingPerformanceModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**txCheckInputs** | **Integer** | | [optional] | +|**txAddOneTx** | **Integer** | | [optional] | +|**txProcessExtra** | **Integer** | | [optional] | +|**txProcessAttachment** | **Integer** | | [optional] | +|**txProcessInputs** | **Integer** | | [optional] | +|**txPushGlobalIndex** | **Integer** | | [optional] | +|**txCheckExist** | **Integer** | | [optional] | +|**txPrintLog** | **Integer** | | [optional] | +|**txPrapareAppend** | **Integer** | | [optional] | +|**txAppend** | **Integer** | | [optional] | +|**txAppendRlWait** | **Integer** | | [optional] | +|**txAppendIsExpired** | **Integer** | | [optional] | +|**txStoreDb** | **Integer** | | [optional] | +|**txCheckInputsPrefixHash** | **Integer** | | [optional] | +|**txCheckInputsAttachmentCheck** | **Integer** | | [optional] | +|**txCheckInputsLoop** | **Integer** | | [optional] | +|**txCheckInputsLoopKimageCheck** | **Integer** | | [optional] | +|**txCheckInputsLoopChInValSig** | **Integer** | | [optional] | +|**txCheckInputsLoopScanOutputkeysGetItemSize** | **Integer** | | [optional] | +|**txCheckInputsLoopScanOutputkeysRelativeToAbsolute** | **Integer** | | [optional] | +|**txCheckInputsLoopScanOutputkeysLoop** | **Integer** | | [optional] | +|**txCheckInputsLoopScanOutputkeysLoopGetSubitem** | **Integer** | | [optional] | +|**txCheckInputsLoopScanOutputkeysLoopFindTx** | **Integer** | | [optional] | +|**txCheckInputsLoopScanOutputkeysLoopHandleOutput** | **Integer** | | [optional] | +|**txMixinCount** | **Integer** | | [optional] | + + + diff --git a/utils/sdk/client/java/docs/VersionModel.md b/utils/sdk/client/java/docs/VersionModel.md new file mode 100644 index 00000000..f5ead7bf --- /dev/null +++ b/utils/sdk/client/java/docs/VersionModel.md @@ -0,0 +1,17 @@ + + +# VersionModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**version** | **String** | | [optional] | +|**versionLong** | **String** | | [optional] | +|**major** | **String** | | [optional] | +|**minor** | **String** | | [optional] | +|**revision** | **String** | | [optional] | + + + diff --git a/utils/sdk/client/java/gradle.properties b/utils/sdk/client/java/gradle.properties new file mode 100644 index 00000000..a3408578 --- /dev/null +++ b/utils/sdk/client/java/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/utils/sdk/client/java/gradle/wrapper/gradle-wrapper.jar b/utils/sdk/client/java/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e6441136f3d4ba8a0da8d277868979cfbc8ad796 GIT binary patch literal 43453 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`; zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf zR2h?lbDZQ`p9P;&DQ4F0sur@TMa!Y}S8irn(%d-gi0*WxxCSk*A?3lGh=gcYN?FGl z7D=Js!i~0=u3rox^eO3i@$0=n{K1lPNU zwmfjRVmLOCRfe=seV&P*1Iq=^i`502keY8Uy-WNPwVNNtJFx?IwAyRPZo2Wo1+S(xF37LJZ~%i)kpFQ3Fw=mXfd@>%+)RpYQLnr}B~~zoof(JVm^^&f zxKV^+3D3$A1G;qh4gPVjhrC8e(VYUHv#dy^)(RoUFM?o%W-EHxufuWf(l*@-l+7vt z=l`qmR56K~F|v<^Pd*p~1_y^P0P^aPC##d8+HqX4IR1gu+7w#~TBFphJxF)T$2WEa zxa?H&6=Qe7d(#tha?_1uQys2KtHQ{)Qco)qwGjrdNL7thd^G5i8Os)CHqc>iOidS} z%nFEDdm=GXBw=yXe1W-ShHHFb?Cc70+$W~z_+}nAoHFYI1MV1wZegw*0y^tC*s%3h zhD3tN8b=Gv&rj}!SUM6|ajSPp*58KR7MPpI{oAJCtY~JECm)*m_x>AZEu>DFgUcby z1Qaw8lU4jZpQ_$;*7RME+gq1KySGG#Wql>aL~k9tLrSO()LWn*q&YxHEuzmwd1?aAtI zBJ>P=&$=l1efe1CDU;`Fd+_;&wI07?V0aAIgc(!{a z0Jg6Y=inXc3^n!U0Atk`iCFIQooHqcWhO(qrieUOW8X(x?(RD}iYDLMjSwffH2~tB z)oDgNBLB^AJBM1M^c5HdRx6fBfka`(LD-qrlh5jqH~);#nw|iyp)()xVYak3;Ybik z0j`(+69aK*B>)e_p%=wu8XC&9e{AO4c~O1U`5X9}?0mrd*m$_EUek{R?DNSh(=br# z#Q61gBzEpmy`$pA*6!87 zSDD+=@fTY7<4A?GLqpA?Pb2z$pbCc4B4zL{BeZ?F-8`s$?>*lXXtn*NC61>|*w7J* z$?!iB{6R-0=KFmyp1nnEmLsA-H0a6l+1uaH^g%c(p{iT&YFrbQ$&PRb8Up#X3@Zsk zD^^&LK~111%cqlP%!_gFNa^dTYT?rhkGl}5=fL{a`UViaXWI$k-UcHJwmaH1s=S$4 z%4)PdWJX;hh5UoK?6aWoyLxX&NhNRqKam7tcOkLh{%j3K^4Mgx1@i|Pi&}<^5>hs5 zm8?uOS>%)NzT(%PjVPGa?X%`N2TQCKbeH2l;cTnHiHppPSJ<7y-yEIiC!P*ikl&!B z%+?>VttCOQM@ShFguHVjxX^?mHX^hSaO_;pnyh^v9EumqSZTi+#f&_Vaija0Q-e*| z7ulQj6Fs*bbmsWp{`auM04gGwsYYdNNZcg|ph0OgD>7O}Asn7^Z=eI>`$2*v78;sj-}oMoEj&@)9+ycEOo92xSyY344^ z11Hb8^kdOvbf^GNAK++bYioknrpdN>+u8R?JxG=!2Kd9r=YWCOJYXYuM0cOq^FhEd zBg2puKy__7VT3-r*dG4c62Wgxi52EMCQ`bKgf*#*ou(D4-ZN$+mg&7$u!! z-^+Z%;-3IDwqZ|K=ah85OLwkO zKxNBh+4QHh)u9D?MFtpbl)us}9+V!D%w9jfAMYEb>%$A;u)rrI zuBudh;5PN}_6J_}l55P3l_)&RMlH{m!)ai-i$g)&*M`eN$XQMw{v^r@-125^RRCF0 z^2>|DxhQw(mtNEI2Kj(;KblC7x=JlK$@78`O~>V!`|1Lm-^JR$-5pUANAnb(5}B}JGjBsliK4& zk6y(;$e&h)lh2)L=bvZKbvh@>vLlreBdH8No2>$#%_Wp1U0N7Ank!6$dFSi#xzh|( zRi{Uw%-4W!{IXZ)fWx@XX6;&(m_F%c6~X8hx=BN1&q}*( zoaNjWabE{oUPb!Bt$eyd#$5j9rItB-h*5JiNi(v^e|XKAj*8(k<5-2$&ZBR5fF|JA z9&m4fbzNQnAU}r8ab>fFV%J0z5awe#UZ|bz?Ur)U9bCIKWEzi2%A+5CLqh?}K4JHi z4vtM;+uPsVz{Lfr;78W78gC;z*yTch~4YkLr&m-7%-xc ztw6Mh2d>_iO*$Rd8(-Cr1_V8EO1f*^@wRoSozS) zy1UoC@pruAaC8Z_7~_w4Q6n*&B0AjOmMWa;sIav&gu z|J5&|{=a@vR!~k-OjKEgPFCzcJ>#A1uL&7xTDn;{XBdeM}V=l3B8fE1--DHjSaxoSjNKEM9|U9#m2<3>n{Iuo`r3UZp;>GkT2YBNAh|b z^jTq-hJp(ebZh#Lk8hVBP%qXwv-@vbvoREX$TqRGTgEi$%_F9tZES@z8Bx}$#5eeG zk^UsLBH{bc2VBW)*EdS({yw=?qmevwi?BL6*=12k9zM5gJv1>y#ML4!)iiPzVaH9% zgSImetD@dam~e>{LvVh!phhzpW+iFvWpGT#CVE5TQ40n%F|p(sP5mXxna+Ev7PDwA zamaV4m*^~*xV+&p;W749xhb_X=$|LD;FHuB&JL5?*Y2-oIT(wYY2;73<^#46S~Gx| z^cez%V7x$81}UWqS13Gz80379Rj;6~WdiXWOSsdmzY39L;Hg3MH43o*y8ibNBBH`(av4|u;YPq%{R;IuYow<+GEsf@R?=@tT@!}?#>zIIn0CoyV!hq3mw zHj>OOjfJM3F{RG#6ujzo?y32m^tgSXf@v=J$ELdJ+=5j|=F-~hP$G&}tDZsZE?5rX ztGj`!S>)CFmdkccxM9eGIcGnS2AfK#gXwj%esuIBNJQP1WV~b~+D7PJTmWGTSDrR` zEAu4B8l>NPuhsk5a`rReSya2nfV1EK01+G!x8aBdTs3Io$u5!6n6KX%uv@DxAp3F@{4UYg4SWJtQ-W~0MDb|j-$lwVn znAm*Pl!?Ps&3wO=R115RWKb*JKoexo*)uhhHBncEDMSVa_PyA>k{Zm2(wMQ(5NM3# z)jkza|GoWEQo4^s*wE(gHz?Xsg4`}HUAcs42cM1-qq_=+=!Gk^y710j=66(cSWqUe zklbm8+zB_syQv5A2rj!Vbw8;|$@C!vfNmNV!yJIWDQ>{+2x zKjuFX`~~HKG~^6h5FntRpnnHt=D&rq0>IJ9#F0eM)Y-)GpRjiN7gkA8wvnG#K=q{q z9dBn8_~wm4J<3J_vl|9H{7q6u2A!cW{bp#r*-f{gOV^e=8S{nc1DxMHFwuM$;aVI^ zz6A*}m8N-&x8;aunp1w7_vtB*pa+OYBw=TMc6QK=mbA-|Cf* zvyh8D4LRJImooUaSb7t*fVfih<97Gf@VE0|z>NcBwBQze);Rh!k3K_sfunToZY;f2 z^HmC4KjHRVg+eKYj;PRN^|E0>Gj_zagfRbrki68I^#~6-HaHg3BUW%+clM1xQEdPYt_g<2K+z!$>*$9nQ>; zf9Bei{?zY^-e{q_*|W#2rJG`2fy@{%6u0i_VEWTq$*(ZN37|8lFFFt)nCG({r!q#9 z5VK_kkSJ3?zOH)OezMT{!YkCuSSn!K#-Rhl$uUM(bq*jY? zi1xbMVthJ`E>d>(f3)~fozjg^@eheMF6<)I`oeJYx4*+M&%c9VArn(OM-wp%M<-`x z7sLP1&3^%Nld9Dhm@$3f2}87!quhI@nwd@3~fZl_3LYW-B?Ia>ui`ELg z&Qfe!7m6ze=mZ`Ia9$z|ARSw|IdMpooY4YiPN8K z4B(ts3p%2i(Td=tgEHX z0UQ_>URBtG+-?0E;E7Ld^dyZ;jjw0}XZ(}-QzC6+NN=40oDb2^v!L1g9xRvE#@IBR zO!b-2N7wVfLV;mhEaXQ9XAU+>=XVA6f&T4Z-@AX!leJ8obP^P^wP0aICND?~w&NykJ#54x3_@r7IDMdRNy4Hh;h*!u(Ol(#0bJdwEo$5437-UBjQ+j=Ic>Q2z` zJNDf0yO6@mr6y1#n3)s(W|$iE_i8r@Gd@!DWDqZ7J&~gAm1#~maIGJ1sls^gxL9LLG_NhU!pTGty!TbhzQnu)I*S^54U6Yu%ZeCg`R>Q zhBv$n5j0v%O_j{QYWG!R9W?5_b&67KB$t}&e2LdMvd(PxN6Ir!H4>PNlerpBL>Zvyy!yw z-SOo8caEpDt(}|gKPBd$qND5#a5nju^O>V&;f890?yEOfkSG^HQVmEbM3Ugzu+UtH zC(INPDdraBN?P%kE;*Ae%Wto&sgw(crfZ#Qy(<4nk;S|hD3j{IQRI6Yq|f^basLY; z-HB&Je%Gg}Jt@={_C{L$!RM;$$|iD6vu#3w?v?*;&()uB|I-XqEKqZPS!reW9JkLewLb!70T7n`i!gNtb1%vN- zySZj{8-1>6E%H&=V}LM#xmt`J3XQoaD|@XygXjdZ1+P77-=;=eYpoEQ01B@L*a(uW zrZeZz?HJsw_4g0vhUgkg@VF8<-X$B8pOqCuWAl28uB|@r`19DTUQQsb^pfqB6QtiT z*`_UZ`fT}vtUY#%sq2{rchyfu*pCg;uec2$-$N_xgjZcoumE5vSI{+s@iLWoz^Mf; zuI8kDP{!XY6OP~q5}%1&L}CtfH^N<3o4L@J@zg1-mt{9L`s^z$Vgb|mr{@WiwAqKg zp#t-lhrU>F8o0s1q_9y`gQNf~Vb!F%70f}$>i7o4ho$`uciNf=xgJ>&!gSt0g;M>*x4-`U)ysFW&Vs^Vk6m%?iuWU+o&m(2Jm26Y(3%TL; zA7T)BP{WS!&xmxNw%J=$MPfn(9*^*TV;$JwRy8Zl*yUZi8jWYF>==j~&S|Xinsb%c z2?B+kpet*muEW7@AzjBA^wAJBY8i|#C{WtO_or&Nj2{=6JTTX05}|H>N2B|Wf!*3_ z7hW*j6p3TvpghEc6-wufFiY!%-GvOx*bZrhZu+7?iSrZL5q9}igiF^*R3%DE4aCHZ zqu>xS8LkW+Auv%z-<1Xs92u23R$nk@Pk}MU5!gT|c7vGlEA%G^2th&Q*zfg%-D^=f z&J_}jskj|Q;73NP4<4k*Y%pXPU2Thoqr+5uH1yEYM|VtBPW6lXaetokD0u z9qVek6Q&wk)tFbQ8(^HGf3Wp16gKmr>G;#G(HRBx?F`9AIRboK+;OfHaLJ(P>IP0w zyTbTkx_THEOs%Q&aPrxbZrJlio+hCC_HK<4%f3ZoSAyG7Dn`=X=&h@m*|UYO-4Hq0 z-Bq&+Ie!S##4A6OGoC~>ZW`Y5J)*ouaFl_e9GA*VSL!O_@xGiBw!AF}1{tB)z(w%c zS1Hmrb9OC8>0a_$BzeiN?rkPLc9%&;1CZW*4}CDDNr2gcl_3z+WC15&H1Zc2{o~i) z)LLW=WQ{?ricmC`G1GfJ0Yp4Dy~Ba;j6ZV4r{8xRs`13{dD!xXmr^Aga|C=iSmor% z8hi|pTXH)5Yf&v~exp3o+sY4B^^b*eYkkCYl*T{*=-0HniSA_1F53eCb{x~1k3*`W zr~};p1A`k{1DV9=UPnLDgz{aJH=-LQo<5%+Em!DNN252xwIf*wF_zS^!(XSm(9eoj z=*dXG&n0>)_)N5oc6v!>-bd(2ragD8O=M|wGW z!xJQS<)u70m&6OmrF0WSsr@I%T*c#Qo#Ha4d3COcX+9}hM5!7JIGF>7<~C(Ear^Sn zm^ZFkV6~Ula6+8S?oOROOA6$C&q&dp`>oR-2Ym3(HT@O7Sd5c~+kjrmM)YmgPH*tL zX+znN>`tv;5eOfX?h{AuX^LK~V#gPCu=)Tigtq9&?7Xh$qN|%A$?V*v=&-2F$zTUv z`C#WyIrChS5|Kgm_GeudCFf;)!WH7FI60j^0o#65o6`w*S7R@)88n$1nrgU(oU0M9 zx+EuMkC>(4j1;m6NoGqEkpJYJ?vc|B zOlwT3t&UgL!pX_P*6g36`ZXQ; z9~Cv}ANFnJGp(;ZhS(@FT;3e)0)Kp;h^x;$*xZn*k0U6-&FwI=uOGaODdrsp-!K$Ac32^c{+FhI-HkYd5v=`PGsg%6I`4d9Jy)uW0y%) zm&j^9WBAp*P8#kGJUhB!L?a%h$hJgQrx!6KCB_TRo%9{t0J7KW8!o1B!NC)VGLM5! zpZy5Jc{`r{1e(jd%jsG7k%I+m#CGS*BPA65ZVW~fLYw0dA-H_}O zrkGFL&P1PG9p2(%QiEWm6x;U-U&I#;Em$nx-_I^wtgw3xUPVVu zqSuKnx&dIT-XT+T10p;yjo1Y)z(x1fb8Dzfn8e yu?e%!_ptzGB|8GrCfu%p?(_ zQccdaaVK$5bz;*rnyK{_SQYM>;aES6Qs^lj9lEs6_J+%nIiuQC*fN;z8md>r_~Mfl zU%p5Dt_YT>gQqfr@`cR!$NWr~+`CZb%dn;WtzrAOI>P_JtsB76PYe*<%H(y>qx-`Kq!X_; z<{RpAqYhE=L1r*M)gNF3B8r(<%8mo*SR2hu zccLRZwGARt)Hlo1euqTyM>^!HK*!Q2P;4UYrysje@;(<|$&%vQekbn|0Ruu_Io(w4#%p6ld2Yp7tlA`Y$cciThP zKzNGIMPXX%&Ud0uQh!uQZz|FB`4KGD?3!ND?wQt6!n*f4EmCoJUh&b?;B{|lxs#F- z31~HQ`SF4x$&v00@(P+j1pAaj5!s`)b2RDBp*PB=2IB>oBF!*6vwr7Dp%zpAx*dPr zb@Zjq^XjN?O4QcZ*O+8>)|HlrR>oD*?WQl5ri3R#2?*W6iJ>>kH%KnnME&TT@ZzrHS$Q%LC?n|e>V+D+8D zYc4)QddFz7I8#}y#Wj6>4P%34dZH~OUDb?uP%-E zwjXM(?Sg~1!|wI(RVuxbu)-rH+O=igSho_pDCw(c6b=P zKk4ATlB?bj9+HHlh<_!&z0rx13K3ZrAR8W)!@Y}o`?a*JJsD+twZIv`W)@Y?Amu_u zz``@-e2X}27$i(2=9rvIu5uTUOVhzwu%mNazS|lZb&PT;XE2|B&W1>=B58#*!~D&) zfVmJGg8UdP*fx(>Cj^?yS^zH#o-$Q-*$SnK(ZVFkw+er=>N^7!)FtP3y~Xxnu^nzY zikgB>Nj0%;WOltWIob|}%lo?_C7<``a5hEkx&1ku$|)i>Rh6@3h*`slY=9U}(Ql_< zaNG*J8vb&@zpdhAvv`?{=zDedJ23TD&Zg__snRAH4eh~^oawdYi6A3w8<Ozh@Kw)#bdktM^GVb zrG08?0bG?|NG+w^&JvD*7LAbjED{_Zkc`3H!My>0u5Q}m!+6VokMLXxl`Mkd=g&Xx z-a>m*#G3SLlhbKB!)tnzfWOBV;u;ftU}S!NdD5+YtOjLg?X}dl>7m^gOpihrf1;PY zvll&>dIuUGs{Qnd- zwIR3oIrct8Va^Tm0t#(bJD7c$Z7DO9*7NnRZorrSm`b`cxz>OIC;jSE3DO8`hX955ui`s%||YQtt2 z5DNA&pG-V+4oI2s*x^>-$6J?p=I>C|9wZF8z;VjR??Icg?1w2v5Me+FgAeGGa8(3S z4vg*$>zC-WIVZtJ7}o9{D-7d>zCe|z#<9>CFve-OPAYsneTb^JH!Enaza#j}^mXy1 z+ULn^10+rWLF6j2>Ya@@Kq?26>AqK{A_| zQKb*~F1>sE*=d?A?W7N2j?L09_7n+HGi{VY;MoTGr_)G9)ot$p!-UY5zZ2Xtbm=t z@dpPSGwgH=QtIcEulQNI>S-#ifbnO5EWkI;$A|pxJd885oM+ zGZ0_0gDvG8q2xebj+fbCHYfAXuZStH2j~|d^sBAzo46(K8n59+T6rzBwK)^rfPT+B zyIFw)9YC-V^rhtK`!3jrhmW-sTmM+tPH+;nwjL#-SjQPUZ53L@A>y*rt(#M(qsiB2 zx6B)dI}6Wlsw%bJ8h|(lhkJVogQZA&n{?Vgs6gNSXzuZpEyu*xySy8ro07QZ7Vk1!3tJphN_5V7qOiyK8p z#@jcDD8nmtYi1^l8ml;AF<#IPK?!pqf9D4moYk>d99Im}Jtwj6c#+A;f)CQ*f-hZ< z=p_T86jog%!p)D&5g9taSwYi&eP z#JuEK%+NULWus;0w32-SYFku#i}d~+{Pkho&^{;RxzP&0!RCm3-9K6`>KZpnzS6?L z^H^V*s!8<>x8bomvD%rh>Zp3>Db%kyin;qtl+jAv8Oo~1g~mqGAC&Qi_wy|xEt2iz zWAJEfTV%cl2Cs<1L&DLRVVH05EDq`pH7Oh7sR`NNkL%wi}8n>IXcO40hp+J+sC!W?!krJf!GJNE8uj zg-y~Ns-<~D?yqbzVRB}G>0A^f0!^N7l=$m0OdZuqAOQqLc zX?AEGr1Ht+inZ-Qiwnl@Z0qukd__a!C*CKuGdy5#nD7VUBM^6OCpxCa2A(X;e0&V4 zM&WR8+wErQ7UIc6LY~Q9x%Sn*Tn>>P`^t&idaOEnOd(Ufw#>NoR^1QdhJ8s`h^|R_ zXX`c5*O~Xdvh%q;7L!_!ohf$NfEBmCde|#uVZvEo>OfEq%+Ns7&_f$OR9xsihRpBb z+cjk8LyDm@U{YN>+r46?nn{7Gh(;WhFw6GAxtcKD+YWV?uge>;+q#Xx4!GpRkVZYu zzsF}1)7$?%s9g9CH=Zs+B%M_)+~*j3L0&Q9u7!|+T`^O{xE6qvAP?XWv9_MrZKdo& z%IyU)$Q95AB4!#hT!_dA>4e@zjOBD*Y=XjtMm)V|+IXzjuM;(l+8aA5#Kaz_$rR6! zj>#&^DidYD$nUY(D$mH`9eb|dtV0b{S>H6FBfq>t5`;OxA4Nn{J(+XihF(stSche7$es&~N$epi&PDM_N`As;*9D^L==2Q7Z2zD+CiU(|+-kL*VG+&9!Yb3LgPy?A zm7Z&^qRG_JIxK7-FBzZI3Q<;{`DIxtc48k> zc|0dmX;Z=W$+)qE)~`yn6MdoJ4co;%!`ddy+FV538Y)j(vg}5*k(WK)KWZ3WaOG!8 z!syGn=s{H$odtpqFrT#JGM*utN7B((abXnpDM6w56nhw}OY}0TiTG1#f*VFZr+^-g zbP10`$LPq_;PvrA1XXlyx2uM^mrjTzX}w{yuLo-cOClE8MMk47T25G8M!9Z5ypOSV zAJUBGEg5L2fY)ZGJb^E34R2zJ?}Vf>{~gB!8=5Z) z9y$>5c)=;o0HeHHSuE4U)#vG&KF|I%-cF6f$~pdYJWk_dD}iOA>iA$O$+4%@>JU08 zS`ep)$XLPJ+n0_i@PkF#ri6T8?ZeAot$6JIYHm&P6EB=BiaNY|aA$W0I+nz*zkz_z zkEru!tj!QUffq%)8y0y`T&`fuus-1p>=^hnBiBqD^hXrPs`PY9tU3m0np~rISY09> z`P3s=-kt_cYcxWd{de@}TwSqg*xVhp;E9zCsnXo6z z?f&Sv^U7n4`xr=mXle94HzOdN!2kB~4=%)u&N!+2;z6UYKUDqi-s6AZ!haB;@&B`? z_TRX0%@suz^TRdCb?!vNJYPY8L_}&07uySH9%W^Tc&1pia6y1q#?*Drf}GjGbPjBS zbOPcUY#*$3sL2x4v_i*Y=N7E$mR}J%|GUI(>WEr+28+V z%v5{#e!UF*6~G&%;l*q*$V?&r$Pp^sE^i-0$+RH3ERUUdQ0>rAq2(2QAbG}$y{de( z>{qD~GGuOk559Y@%$?N^1ApVL_a704>8OD%8Y%8B;FCt%AoPu8*D1 zLB5X>b}Syz81pn;xnB}%0FnwazlWfUV)Z-~rZg6~b z6!9J$EcE&sEbzcy?CI~=boWA&eeIa%z(7SE^qgVLz??1Vbc1*aRvc%Mri)AJaAG!p z$X!_9Ds;Zz)f+;%s&dRcJt2==P{^j3bf0M=nJd&xwUGlUFn?H=2W(*2I2Gdu zv!gYCwM10aeus)`RIZSrCK=&oKaO_Ry~D1B5!y0R=%!i2*KfXGYX&gNv_u+n9wiR5 z*e$Zjju&ODRW3phN925%S(jL+bCHv6rZtc?!*`1TyYXT6%Ju=|X;6D@lq$8T zW{Y|e39ioPez(pBH%k)HzFITXHvnD6hw^lIoUMA;qAJ^CU?top1fo@s7xT13Fvn1H z6JWa-6+FJF#x>~+A;D~;VDs26>^oH0EI`IYT2iagy23?nyJ==i{g4%HrAf1-*v zK1)~@&(KkwR7TL}L(A@C_S0G;-GMDy=MJn2$FP5s<%wC)4jC5PXoxrQBFZ_k0P{{s@sz+gX`-!=T8rcB(=7vW}^K6oLWMmp(rwDh}b zwaGGd>yEy6fHv%jM$yJXo5oMAQ>c9j`**}F?MCry;T@47@r?&sKHgVe$MCqk#Z_3S z1GZI~nOEN*P~+UaFGnj{{Jo@16`(qVNtbU>O0Hf57-P>x8Jikp=`s8xWs^dAJ9lCQ z)GFm+=OV%AMVqVATtN@|vp61VVAHRn87}%PC^RAzJ%JngmZTasWBAWsoAqBU+8L8u z4A&Pe?fmTm0?mK-BL9t+{y7o(7jm+RpOhL9KnY#E&qu^}B6=K_dB}*VlSEiC9fn)+V=J;OnN)Ta5v66ic1rG+dGAJ1 z1%Zb_+!$=tQ~lxQrzv3x#CPb?CekEkA}0MYSgx$Jdd}q8+R=ma$|&1a#)TQ=l$1tQ z=tL9&_^vJ)Pk}EDO-va`UCT1m#Uty1{v^A3P~83_#v^ozH}6*9mIjIr;t3Uv%@VeW zGL6(CwCUp)Jq%G0bIG%?{_*Y#5IHf*5M@wPo6A{$Um++Co$wLC=J1aoG93&T7Ho}P z=mGEPP7GbvoG!uD$k(H3A$Z))+i{Hy?QHdk>3xSBXR0j!11O^mEe9RHmw!pvzv?Ua~2_l2Yh~_!s1qS`|0~0)YsbHSz8!mG)WiJE| z2f($6TQtt6L_f~ApQYQKSb=`053LgrQq7G@98#igV>y#i==-nEjQ!XNu9 z~;mE+gtj4IDDNQJ~JVk5Ux6&LCSFL!y=>79kE9=V}J7tD==Ga+IW zX)r7>VZ9dY=V&}DR))xUoV!u(Z|%3ciQi_2jl}3=$Agc(`RPb z8kEBpvY>1FGQ9W$n>Cq=DIpski};nE)`p3IUw1Oz0|wxll^)4dq3;CCY@RyJgFgc# zKouFh!`?Xuo{IMz^xi-h=StCis_M7yq$u) z?XHvw*HP0VgR+KR6wI)jEMX|ssqYvSf*_3W8zVTQzD?3>H!#>InzpSO)@SC8q*ii- z%%h}_#0{4JG;Jm`4zg};BPTGkYamx$Xo#O~lBirRY)q=5M45n{GCfV7h9qwyu1NxOMoP4)jjZMxmT|IQQh0U7C$EbnMN<3)Kk?fFHYq$d|ICu>KbY_hO zTZM+uKHe(cIZfEqyzyYSUBZa8;Fcut-GN!HSA9ius`ltNebF46ZX_BbZNU}}ZOm{M2&nANL9@0qvih15(|`S~z}m&h!u4x~(%MAO$jHRWNfuxWF#B)E&g3ghSQ9|> z(MFaLQj)NE0lowyjvg8z0#m6FIuKE9lDO~Glg}nSb7`~^&#(Lw{}GVOS>U)m8bF}x zVjbXljBm34Cs-yM6TVusr+3kYFjr28STT3g056y3cH5Tmge~ASxBj z%|yb>$eF;WgrcOZf569sDZOVwoo%8>XO>XQOX1OyN9I-SQgrm;U;+#3OI(zrWyow3 zk==|{lt2xrQ%FIXOTejR>;wv(Pb8u8}BUpx?yd(Abh6? zsoO3VYWkeLnF43&@*#MQ9-i-d0t*xN-UEyNKeyNMHw|A(k(_6QKO=nKMCxD(W(Yop zsRQ)QeL4X3Lxp^L%wzi2-WVSsf61dqliPUM7srDB?Wm6Lzn0&{*}|IsKQW;02(Y&| zaTKv|`U(pSzuvR6Rduu$wzK_W-Y-7>7s?G$)U}&uK;<>vU}^^ns@Z!p+9?St1s)dG zK%y6xkPyyS1$~&6v{kl?Md6gwM|>mt6Upm>oa8RLD^8T{0?HC!Z>;(Bob7el(DV6x zi`I)$&E&ngwFS@bi4^xFLAn`=fzTC;aimE^!cMI2n@Vo%Ae-ne`RF((&5y6xsjjAZ zVguVoQ?Z9uk$2ON;ersE%PU*xGO@T*;j1BO5#TuZKEf(mB7|g7pcEA=nYJ{s3vlbg zd4-DUlD{*6o%Gc^N!Nptgay>j6E5;3psI+C3Q!1ZIbeCubW%w4pq9)MSDyB{HLm|k zxv-{$$A*pS@csolri$Ge<4VZ}e~78JOL-EVyrbxKra^d{?|NnPp86!q>t<&IP07?Z z^>~IK^k#OEKgRH+LjllZXk7iA>2cfH6+(e&9ku5poo~6y{GC5>(bRK7hwjiurqAiZ zg*DmtgY}v83IjE&AbiWgMyFbaRUPZ{lYiz$U^&Zt2YjG<%m((&_JUbZcfJ22(>bi5 z!J?<7AySj0JZ&<-qXX;mcV!f~>G=sB0KnjWca4}vrtunD^1TrpfeS^4dvFr!65knK zZh`d;*VOkPs4*-9kL>$GP0`(M!j~B;#x?Ba~&s6CopvO86oM?-? zOw#dIRc;6A6T?B`Qp%^<U5 z19x(ywSH$_N+Io!6;e?`tWaM$`=Db!gzx|lQ${DG!zb1Zl&|{kX0y6xvO1o z220r<-oaS^^R2pEyY;=Qllqpmue|5yI~D|iI!IGt@iod{Opz@*ml^w2bNs)p`M(Io z|E;;m*Xpjd9l)4G#KaWfV(t8YUn@A;nK^#xgv=LtnArX|vWQVuw3}B${h+frU2>9^ z!l6)!Uo4`5k`<<;E(ido7M6lKTgWezNLq>U*=uz&s=cc$1%>VrAeOoUtA|T6gO4>UNqsdK=NF*8|~*sl&wI=x9-EGiq*aqV!(VVXA57 zw9*o6Ir8Lj1npUXvlevtn(_+^X5rzdR>#(}4YcB9O50q97%rW2me5_L=%ffYPUSRc z!vv?Kv>dH994Qi>U(a<0KF6NH5b16enCp+mw^Hb3Xs1^tThFpz!3QuN#}KBbww`(h z7GO)1olDqy6?T$()R7y%NYx*B0k_2IBiZ14&8|JPFxeMF{vSTxF-Vi3+ZOI=Thq2} zyQgjYY1_7^ZQHh{?P))4+qUiQJLi1&{yE>h?~jU%tjdV0h|FENbM3X(KnJdPKc?~k zh=^Ixv*+smUll!DTWH!jrV*wSh*(mx0o6}1@JExzF(#9FXgmTXVoU+>kDe68N)dkQ zH#_98Zv$}lQwjKL@yBd;U(UD0UCl322=pav<=6g>03{O_3oKTq;9bLFX1ia*lw;#K zOiYDcBJf)82->83N_Y(J7Kr_3lE)hAu;)Q(nUVydv+l+nQ$?|%MWTy`t>{havFSQloHwiIkGK9YZ79^9?AZo0ZyQlVR#}lF%dn5n%xYksXf8gnBm=wO7g_^! zauQ-bH1Dc@3ItZ-9D_*pH}p!IG7j8A_o94#~>$LR|TFq zZ-b00*nuw|-5C2lJDCw&8p5N~Z1J&TrcyErds&!l3$eSz%`(*izc;-?HAFD9AHb-| z>)id`QCrzRws^9(#&=pIx9OEf2rmlob8sK&xPCWS+nD~qzU|qG6KwA{zbikcfQrdH z+ zQg>O<`K4L8rN7`GJB0*3<3`z({lWe#K!4AZLsI{%z#ja^OpfjU{!{)x0ZH~RB0W5X zTwN^w=|nA!4PEU2=LR05x~}|B&ZP?#pNgDMwD*ajI6oJqv!L81gu=KpqH22avXf0w zX3HjbCI!n9>l046)5rr5&v5ja!xkKK42zmqHzPx$9Nn_MZk`gLeSLgC=LFf;H1O#B zn=8|^1iRrujHfbgA+8i<9jaXc;CQBAmQvMGQPhFec2H1knCK2x!T`e6soyrqCamX% zTQ4dX_E*8so)E*TB$*io{$c6X)~{aWfaqdTh=xEeGvOAN9H&-t5tEE-qso<+C!2>+ zskX51H-H}#X{A75wqFe-J{?o8Bx|>fTBtl&tcbdR|132Ztqu5X0i-pisB-z8n71%q%>EF}yy5?z=Ve`}hVh{Drv1YWL zW=%ug_&chF11gDv3D6B)Tz5g54H0mDHNjuKZ+)CKFk4Z|$RD zfRuKLW`1B>B?*RUfVd0+u8h3r-{@fZ{k)c!93t1b0+Q9vOaRnEn1*IL>5Z4E4dZ!7 ztp4GP-^1d>8~LMeb}bW!(aAnB1tM_*la=Xx)q(I0Y@__Zd$!KYb8T2VBRw%e$iSdZ zkwdMwd}eV9q*;YvrBFTv1>1+}{H!JK2M*C|TNe$ZSA>UHKk);wz$(F$rXVc|sI^lD zV^?_J!3cLM;GJuBMbftbaRUs$;F}HDEDtIeHQ)^EJJ1F9FKJTGH<(Jj`phE6OuvE) zqK^K`;3S{Y#1M@8yRQwH`?kHMq4tHX#rJ>5lY3DM#o@or4&^_xtBC(|JpGTfrbGkA z2Tu+AyT^pHannww!4^!$5?@5v`LYy~T`qs7SYt$JgrY(w%C+IWA;ZkwEF)u5sDvOK zGk;G>Mh&elvXDcV69J_h02l&O;!{$({fng9Rlc3ID#tmB^FIG^w{HLUpF+iB`|
NnX)EH+Nua)3Y(c z&{(nX_ht=QbJ%DzAya}!&uNu!4V0xI)QE$SY__m)SAKcN0P(&JcoK*Lxr@P zY&P=}&B3*UWNlc|&$Oh{BEqwK2+N2U$4WB7Fd|aIal`FGANUa9E-O)!gV`((ZGCc$ zBJA|FFrlg~9OBp#f7aHodCe{6= zay$6vN~zj1ddMZ9gQ4p32(7wD?(dE>KA2;SOzXRmPBiBc6g`eOsy+pVcHu=;Yd8@{ zSGgXf@%sKKQz~;!J;|2fC@emm#^_rnO0esEn^QxXgJYd`#FPWOUU5b;9eMAF zZhfiZb|gk8aJIw*YLp4!*(=3l8Cp{(%p?ho22*vN9+5NLV0TTazNY$B5L6UKUrd$n zjbX%#m7&F#U?QNOBXkiiWB*_tk+H?N3`vg;1F-I+83{M2!8<^nydGr5XX}tC!10&e z7D36bLaB56WrjL&HiiMVtpff|K%|*{t*ltt^5ood{FOG0<>k&1h95qPio)2`eL${YAGIx(b4VN*~nKn6E~SIQUuRH zQ+5zP6jfnP$S0iJ@~t!Ai3o`X7biohli;E zT#yXyl{bojG@-TGZzpdVDXhbmF%F9+-^YSIv|MT1l3j zrxOFq>gd2%U}?6}8mIj?M zc077Zc9fq(-)4+gXv?Az26IO6eV`RAJz8e3)SC7~>%rlzDwySVx*q$ygTR5kW2ds- z!HBgcq0KON9*8Ff$X0wOq$`T7ml(@TF)VeoF}x1OttjuVHn3~sHrMB++}f7f9H%@f z=|kP_?#+fve@{0MlbkC9tyvQ_R?lRdRJ@$qcB(8*jyMyeME5ns6ypVI1Xm*Zr{DuS zZ!1)rQfa89c~;l~VkCiHI|PCBd`S*2RLNQM8!g9L6?n`^evQNEwfO@&JJRme+uopQX0%Jo zgd5G&#&{nX{o?TQwQvF1<^Cg3?2co;_06=~Hcb6~4XWpNFL!WU{+CK;>gH%|BLOh7@!hsa(>pNDAmpcuVO-?;Bic17R}^|6@8DahH)G z!EmhsfunLL|3b=M0MeK2vqZ|OqUqS8npxwge$w-4pFVXFq$_EKrZY?BuP@Az@(k`L z`ViQBSk`y+YwRT;&W| z2e3UfkCo^uTA4}Qmmtqs+nk#gNr2W4 zTH%hhErhB)pkXR{B!q5P3-OM+M;qu~f>}IjtF%>w{~K-0*jPVLl?Chz&zIdxp}bjx zStp&Iufr58FTQ36AHU)0+CmvaOpKF;W@sMTFpJ`j;3d)J_$tNQI^c<^1o<49Z(~K> z;EZTBaVT%14(bFw2ob@?JLQ2@(1pCdg3S%E4*dJ}dA*v}_a4_P(a`cHnBFJxNobAv zf&Zl-Yt*lhn-wjZsq<9v-IsXxAxMZ58C@e0!rzhJ+D@9^3~?~yllY^s$?&oNwyH!#~6x4gUrfxplCvK#!f z$viuszW>MFEcFL?>ux*((!L$;R?xc*myjRIjgnQX79@UPD$6Dz0jutM@7h_pq z0Zr)#O<^y_K6jfY^X%A-ip>P%3saX{!v;fxT-*0C_j4=UMH+Xth(XVkVGiiKE#f)q z%Jp=JT)uy{&}Iq2E*xr4YsJ5>w^=#-mRZ4vPXpI6q~1aFwi+lQcimO45V-JXP;>(Q zo={U`{=_JF`EQj87Wf}{Qy35s8r1*9Mxg({CvOt}?Vh9d&(}iI-quvs-rm~P;eRA@ zG5?1HO}puruc@S{YNAF3vmUc2B4!k*yi))<5BQmvd3tr}cIs#9)*AX>t`=~{f#Uz0 z0&Nk!7sSZwJe}=)-R^$0{yeS!V`Dh7w{w5rZ9ir!Z7Cd7dwZcK;BT#V0bzTt>;@Cl z#|#A!-IL6CZ@eHH!CG>OO8!%G8&8t4)Ro@}USB*k>oEUo0LsljsJ-%5Mo^MJF2I8- z#v7a5VdJ-Cd%(a+y6QwTmi+?f8Nxtm{g-+WGL>t;s#epv7ug>inqimZCVm!uT5Pf6 ziEgQt7^%xJf#!aPWbuC_3Nxfb&CFbQy!(8ANpkWLI4oSnH?Q3f?0k1t$3d+lkQs{~(>06l&v|MpcFsyAv zin6N!-;pggosR*vV=DO(#+}4ps|5$`udE%Kdmp?G7B#y%H`R|i8skKOd9Xzx8xgR$>Zo2R2Ytktq^w#ul4uicxW#{ zFjG_RNlBroV_n;a7U(KIpcp*{M~e~@>Q#Av90Jc5v%0c>egEdY4v3%|K1XvB{O_8G zkTWLC>OZKf;XguMH2-Pw{BKbFzaY;4v2seZV0>^7Q~d4O=AwaPhP3h|!hw5aqOtT@ z!SNz}$of**Bl3TK209@F=Tn1+mgZa8yh(Png%Zd6Mt}^NSjy)etQrF zme*llAW=N_8R*O~d2!apJnF%(JcN??=`$qs3Y+~xs>L9x`0^NIn!8mMRFA_tg`etw z3k{9JAjnl@ygIiJcNHTy02GMAvBVqEss&t2<2mnw!; zU`J)0>lWiqVqo|ex7!+@0i>B~BSU1A_0w#Ee+2pJx0BFiZ7RDHEvE*ptc9md(B{&+ zKE>TM)+Pd>HEmdJao7U@S>nL(qq*A)#eLOuIfAS@j`_sK0UEY6OAJJ-kOrHG zjHx`g!9j*_jRcJ%>CE9K2MVf?BUZKFHY?EpV6ai7sET-tqk=nDFh-(65rhjtlKEY% z@G&cQ<5BKatfdA1FKuB=i>CCC5(|9TMW%K~GbA4}80I5%B}(gck#Wlq@$nO3%@QP_ z8nvPkJFa|znk>V92cA!K1rKtr)skHEJD;k8P|R8RkCq1Rh^&}Evwa4BUJz2f!2=MH zo4j8Y$YL2313}H~F7@J7mh>u%556Hw0VUOz-Un@ZASCL)y8}4XXS`t1AC*^>PLwIc zUQok5PFS=*#)Z!3JZN&eZ6ZDP^-c@StY*t20JhCnbMxXf=LK#;`4KHEqMZ-Ly9KsS zI2VUJGY&PmdbM+iT)zek)#Qc#_i4uH43 z@T5SZBrhNCiK~~esjsO9!qBpaWK<`>!-`b71Y5ReXQ4AJU~T2Njri1CEp5oKw;Lnm)-Y@Z3sEY}XIgSy%xo=uek(kAAH5MsV$V3uTUsoTzxp_rF=tx zV07vlJNKtJhCu`b}*#m&5LV4TAE&%KtHViDAdv#c^x`J7bg z&N;#I2GkF@SIGht6p-V}`!F_~lCXjl1BdTLIjD2hH$J^YFN`7f{Q?OHPFEM$65^!u zNwkelo*5+$ZT|oQ%o%;rBX$+?xhvjb)SHgNHE_yP%wYkkvXHS{Bf$OiKJ5d1gI0j< zF6N}Aq=(WDo(J{e-uOecxPD>XZ@|u-tgTR<972`q8;&ZD!cep^@B5CaqFz|oU!iFj zU0;6fQX&~15E53EW&w1s9gQQ~Zk16X%6 zjG`j0yq}4deX2?Tr(03kg>C(!7a|b9qFI?jcE^Y>-VhudI@&LI6Qa}WQ>4H_!UVyF z((cm&!3gmq@;BD#5P~0;_2qgZhtJS|>WdtjY=q zLnHH~Fm!cxw|Z?Vw8*~?I$g#9j&uvgm7vPr#&iZgPP~v~BI4jOv;*OQ?jYJtzO<^y z7-#C={r7CO810!^s(MT!@@Vz_SVU)7VBi(e1%1rvS!?PTa}Uv`J!EP3s6Y!xUgM^8 z4f!fq<3Wer_#;u!5ECZ|^c1{|q_lh3m^9|nsMR1#Qm|?4Yp5~|er2?W^7~cl;_r4WSme_o68J9p03~Hc%X#VcX!xAu%1`R!dfGJCp zV*&m47>s^%Ib0~-2f$6oSgn3jg8m%UA;ArcdcRyM5;}|r;)?a^D*lel5C`V5G=c~k zy*w_&BfySOxE!(~PI$*dwG><+-%KT5p?whOUMA*k<9*gi#T{h3DAxzAPxN&Xws8o9Cp*`PA5>d9*Z-ynV# z9yY*1WR^D8|C%I@vo+d8r^pjJ$>eo|j>XiLWvTWLl(^;JHCsoPgem6PvegHb-OTf| zvTgsHSa;BkbG=(NgPO|CZu9gUCGr$8*EoH2_Z#^BnxF0yM~t`|9ws_xZ8X8iZYqh! zAh;HXJ)3P&)Q0(&F>!LN0g#bdbis-cQxyGn9Qgh`q+~49Fqd2epikEUw9caM%V6WgP)532RMRW}8gNS%V%Hx7apSz}tn@bQy!<=lbhmAH=FsMD?leawbnP5BWM0 z5{)@EEIYMu5;u)!+HQWhQ;D3_Cm_NADNeb-f56}<{41aYq8p4=93d=-=q0Yx#knGYfXVt z+kMxlus}t2T5FEyCN~!}90O_X@@PQpuy;kuGz@bWft%diBTx?d)_xWd_-(!LmVrh**oKg!1CNF&LX4{*j|) zIvjCR0I2UUuuEXh<9}oT_zT#jOrJAHNLFT~Ilh9hGJPI1<5`C-WA{tUYlyMeoy!+U zhA#=p!u1R7DNg9u4|QfED-2TuKI}>p#2P9--z;Bbf4Op*;Q9LCbO&aL2i<0O$ByoI z!9;Ght733FC>Pz>$_mw(F`zU?`m@>gE`9_p*=7o=7av`-&ifU(^)UU`Kg3Kw`h9-1 z6`e6+im=|m2v`pN(2dE%%n8YyQz;#3Q-|x`91z?gj68cMrHl}C25|6(_dIGk*8cA3 zRHB|Nwv{@sP4W+YZM)VKI>RlB`n=Oj~Rzx~M+Khz$N$45rLn6k1nvvD^&HtsMA4`s=MmuOJID@$s8Ph4E zAmSV^+s-z8cfv~Yd(40Sh4JG#F~aB>WFoX7ykaOr3JaJ&Lb49=B8Vk-SQT9%7TYhv z?-Pprt{|=Y5ZQ1?od|A<_IJU93|l4oAfBm?3-wk{O<8ea+`}u%(kub(LFo2zFtd?4 zwpN|2mBNywv+d^y_8#<$r>*5+$wRTCygFLcrwT(qc^n&@9r+}Kd_u@Ithz(6Qb4}A zWo_HdBj#V$VE#l6pD0a=NfB0l^6W^g`vm^sta>Tly?$E&{F?TTX~DsKF~poFfmN%2 z4x`Dc{u{Lkqz&y!33;X}weD}&;7p>xiI&ZUb1H9iD25a(gI|`|;G^NwJPv=1S5e)j z;U;`?n}jnY6rA{V^ zxTd{bK)Gi^odL3l989DQlN+Zs39Xe&otGeY(b5>rlIqfc7Ap4}EC?j<{M=hlH{1+d zw|c}}yx88_xQr`{98Z!d^FNH77=u(p-L{W6RvIn40f-BldeF-YD>p6#)(Qzf)lfZj z?3wAMtPPp>vMehkT`3gToPd%|D8~4`5WK{`#+}{L{jRUMt zrFz+O$C7y8$M&E4@+p+oV5c%uYzbqd2Y%SSgYy#xh4G3hQv>V*BnuKQhBa#=oZB~w{azUB+q%bRe_R^ z>fHBilnRTUfaJ201czL8^~Ix#+qOHSO)A|xWLqOxB$dT2W~)e-r9;bm=;p;RjYahB z*1hegN(VKK+ztr~h1}YP@6cfj{e#|sS`;3tJhIJK=tVJ-*h-5y9n*&cYCSdg#EHE# zSIx=r#qOaLJoVVf6v;(okg6?*L_55atl^W(gm^yjR?$GplNP>BZsBYEf_>wM0Lc;T zhf&gpzOWNxS>m+mN92N0{;4uw`P+9^*|-1~$uXpggj4- z^SFc4`uzj2OwdEVT@}Q`(^EcQ_5(ZtXTql*yGzdS&vrS_w>~~ra|Nb5abwf}Y!uq6R5f&6g2ge~2p(%c< z@O)cz%%rr4*cRJ5f`n@lvHNk@lE1a*96Kw6lJ~B-XfJW%?&-y?;E&?1AacU@`N`!O z6}V>8^%RZ7SQnZ-z$(jsX`amu*5Fj8g!3RTRwK^`2_QHe;_2y_n|6gSaGyPmI#kA0sYV<_qOZc#-2BO%hX)f$s-Z3xlI!ub z^;3ru11DA`4heAu%}HIXo&ctujzE2!6DIGE{?Zs>2}J+p&C$rc7gJC35gxhflorvsb%sGOxpuWhF)dL_&7&Z99=5M0b~Qa;Mo!j&Ti_kXW!86N%n= zSC@6Lw>UQ__F&+&Rzv?gscwAz8IP!n63>SP)^62(HK98nGjLY2*e^OwOq`3O|C92? z;TVhZ2SK%9AGW4ZavTB9?)mUbOoF`V7S=XM;#3EUpR+^oHtdV!GK^nXzCu>tpR|89 zdD{fnvCaN^^LL%amZ^}-E+214g&^56rpdc@yv0b<3}Ys?)f|fXN4oHf$six)-@<;W&&_kj z-B}M5U*1sb4)77aR=@%I?|Wkn-QJVuA96an25;~!gq(g1@O-5VGo7y&E_srxL6ZfS z*R%$gR}dyONgju*D&?geiSj7SZ@ftyA|}(*Y4KbvU!YLsi1EDQQCnb+-cM=K1io78o!v*);o<XwjaQH%)uIP&Zm?)Nfbfn;jIr z)d#!$gOe3QHp}2NBak@yYv3m(CPKkwI|{;d=gi552u?xj9ObCU^DJFQp4t4e1tPzM zvsRIGZ6VF+{6PvqsplMZWhz10YwS={?`~O0Ec$`-!klNUYtzWA^f9m7tkEzCy<_nS z=&<(awFeZvt51>@o_~>PLs05CY)$;}Oo$VDO)?l-{CS1Co=nxjqben*O1BR>#9`0^ zkwk^k-wcLCLGh|XLjdWv0_Hg54B&OzCE^3NCP}~OajK-LuRW53CkV~Su0U>zN%yQP zH8UH#W5P3-!ToO-2k&)}nFe`t+mdqCxxAHgcifup^gKpMObbox9LFK;LP3}0dP-UW z?Zo*^nrQ6*$FtZ(>kLCc2LY*|{!dUn$^RW~m9leoF|@Jy|M5p-G~j%+P0_#orRKf8 zvuu5<*XO!B?1E}-*SY~MOa$6c%2cM+xa8}_8x*aVn~57v&W(0mqN1W`5a7*VN{SUH zXz98DDyCnX2EPl-`Lesf`=AQT%YSDb`$%;(jUTrNen$NPJrlpPDP}prI>Ml!r6bCT;mjsg@X^#&<}CGf0JtR{Ecwd&)2zuhr#nqdgHj+g2n}GK9CHuwO zk>oZxy{vcOL)$8-}L^iVfJHAGfwN$prHjYV0ju}8%jWquw>}_W6j~m<}Jf!G?~r5&Rx)!9JNX!ts#SGe2HzobV5); zpj@&`cNcO&q+%*<%D7za|?m5qlmFK$=MJ_iv{aRs+BGVrs)98BlN^nMr{V_fcl_;jkzRju+c-y?gqBC_@J0dFLq-D9@VN&-`R9U;nv$Hg?>$oe4N&Ht$V_(JR3TG^! zzJsbQbi zFE6-{#9{G{+Z}ww!ycl*7rRdmU#_&|DqPfX3CR1I{Kk;bHwF6jh0opI`UV2W{*|nn zf_Y@%wW6APb&9RrbEN=PQRBEpM(N1w`81s=(xQj6 z-eO0k9=Al|>Ej|Mw&G`%q8e$2xVz1v4DXAi8G};R$y)ww638Y=9y$ZYFDM$}vzusg zUf+~BPX>(SjA|tgaFZr_e0{)+z9i6G#lgt=F_n$d=beAt0Sa0a7>z-?vcjl3e+W}+ z1&9=|vC=$co}-Zh*%3588G?v&U7%N1Qf-wNWJ)(v`iO5KHSkC5&g7CrKu8V}uQGcfcz zmBz#Lbqwqy#Z~UzHgOQ;Q-rPxrRNvl(&u6ts4~0=KkeS;zqURz%!-ERppmd%0v>iRlEf+H$yl{_8TMJzo0 z>n)`On|7=WQdsqhXI?#V{>+~}qt-cQbokEbgwV3QvSP7&hK4R{Z{aGHVS3;+h{|Hz z6$Js}_AJr383c_+6sNR|$qu6dqHXQTc6?(XWPCVZv=)D#6_;D_8P-=zOGEN5&?~8S zl5jQ?NL$c%O)*bOohdNwGIKM#jSAC?BVY={@A#c9GmX0=T(0G}xs`-%f3r=m6-cpK z!%waekyAvm9C3%>sixdZj+I(wQlbB4wv9xKI*T13DYG^T%}zZYJ|0$Oj^YtY+d$V$ zAVudSc-)FMl|54n=N{BnZTM|!>=bhaja?o7s+v1*U$!v!qQ%`T-6fBvmdPbVmro&d zk07TOp*KuxRUSTLRrBj{mjsnF8`d}rMViY8j`jo~Hp$fkv9F_g(jUo#Arp;Xw0M$~ zRIN!B22~$kx;QYmOkos@%|5k)!QypDMVe}1M9tZfkpXKGOxvKXB!=lo`p?|R1l=tA zp(1}c6T3Fwj_CPJwVsYtgeRKg?9?}%oRq0F+r+kdB=bFUdVDRPa;E~~>2$w}>O>v=?|e>#(-Lyx?nbg=ckJ#5U6;RT zNvHhXk$P}m9wSvFyU3}=7!y?Y z=fg$PbV8d7g25&-jOcs{%}wTDKm>!Vk);&rr;O1nvO0VrU&Q?TtYVU=ir`te8SLlS zKSNmV=+vF|ATGg`4$N1uS|n??f}C_4Sz!f|4Ly8#yTW-FBfvS48Tef|-46C(wEO_%pPhUC5$-~Y?!0vFZ^Gu`x=m7X99_?C-`|h zfmMM&Y@zdfitA@KPw4Mc(YHcY1)3*1xvW9V-r4n-9ZuBpFcf{yz+SR{ zo$ZSU_|fgwF~aakGr(9Be`~A|3)B=9`$M-TWKipq-NqRDRQc}ABo*s_5kV%doIX7LRLRau_gd@Rd_aLFXGSU+U?uAqh z8qusWWcvgQ&wu{|sRXmv?sl=xc<$6AR$+cl& zFNh5q1~kffG{3lDUdvEZu5c(aAG~+64FxdlfwY^*;JSS|m~CJusvi-!$XR`6@XtY2 znDHSz7}_Bx7zGq-^5{stTRy|I@N=>*y$zz>m^}^{d&~h;0kYiq8<^Wq7Dz0w31ShO^~LUfW6rfitR0(=3;Uue`Y%y@ex#eKPOW zO~V?)M#AeHB2kovn1v=n^D?2{2jhIQd9t|_Q+c|ZFaWt+r&#yrOu-!4pXAJuxM+Cx z*H&>eZ0v8Y`t}8{TV6smOj=__gFC=eah)mZt9gwz>>W$!>b3O;Rm^Ig*POZP8Rl0f zT~o=Nu1J|lO>}xX&#P58%Yl z83`HRs5#32Qm9mdCrMlV|NKNC+Z~ z9OB8xk5HJ>gBLi+m@(pvpw)1(OaVJKs*$Ou#@Knd#bk+V@y;YXT?)4eP9E5{J%KGtYinNYJUH9PU3A}66c>Xn zZ{Bn0<;8$WCOAL$^NqTjwM?5d=RHgw3!72WRo0c;+houoUA@HWLZM;^U$&sycWrFd zE7ekt9;kb0`lps{>R(}YnXlyGY}5pPd9zBpgXeJTY_jwaJGSJQC#-KJqmh-;ad&F- z-Y)E>!&`Rz!HtCz>%yOJ|v(u7P*I$jqEY3}(Z-orn4 zlI?CYKNl`6I){#2P1h)y(6?i;^z`N3bxTV%wNvQW+eu|x=kbj~s8rhCR*0H=iGkSj zk23lr9kr|p7#qKL=UjgO`@UnvzU)`&fI>1Qs7ubq{@+lK{hH* zvl6eSb9%yngRn^T<;jG1SVa)eA>T^XX=yUS@NCKpk?ovCW1D@!=@kn;l_BrG;hOTC z6K&H{<8K#dI(A+zw-MWxS+~{g$tI7|SfP$EYKxA}LlVO^sT#Oby^grkdZ^^lA}uEF zBSj$weBJG{+Bh@Yffzsw=HyChS(dtLE3i*}Zj@~!_T-Ay7z=B)+*~3|?w`Zd)Co2t zC&4DyB!o&YgSw+fJn6`sn$e)29`kUwAc+1MND7YjV%lO;H2}fNy>hD#=gT ze+-aFNpyKIoXY~Vq-}OWPBe?Rfu^{ps8>Xy%42r@RV#*QV~P83jdlFNgkPN=T|Kt7 zV*M`Rh*30&AWlb$;ae130e@}Tqi3zx2^JQHpM>j$6x`#{mu%tZlwx9Gj@Hc92IuY* zarmT|*d0E~vt6<+r?W^UW0&#U&)8B6+1+;k^2|FWBRP9?C4Rk)HAh&=AS8FS|NQaZ z2j!iZ)nbEyg4ZTp-zHwVlfLC~tXIrv(xrP8PAtR{*c;T24ycA-;auWsya-!kF~CWZ zw_uZ|%urXgUbc@x=L=_g@QJ@m#5beS@6W195Hn7>_}z@Xt{DIEA`A&V82bc^#!q8$ zFh?z_Vn|ozJ;NPd^5uu(9tspo8t%&-U9Ckay-s@DnM*R5rtu|4)~e)`z0P-sy?)kc zs_k&J@0&0!q4~%cKL)2l;N*T&0;mqX5T{Qy60%JtKTQZ-xb%KOcgqwJmb%MOOKk7N zgq})R_6**{8A|6H?fO+2`#QU)p$Ei2&nbj6TpLSIT^D$|`TcSeh+)}VMb}LmvZ{O| ze*1IdCt3+yhdYVxcM)Q_V0bIXLgr6~%JS<<&dxIgfL=Vnx4YHuU@I34JXA|+$_S3~ zy~X#gO_X!cSs^XM{yzDGNM>?v(+sF#<0;AH^YrE8smx<36bUsHbN#y57K8WEu(`qHvQ6cAZPo=J5C(lSmUCZ57Rj6cx!e^rfaI5%w}unz}4 zoX=nt)FVNV%QDJH`o!u9olLD4O5fl)xp+#RloZlaA92o3x4->?rB4`gS$;WO{R;Z3>cG3IgFX2EA?PK^M}@%1%A;?f6}s&CV$cIyEr#q5;yHdNZ9h{| z-=dX+a5elJoDo?Eq&Og!nN6A)5yYpnGEp}?=!C-V)(*~z-+?kY1Q7qs#Rsy%hu_60rdbB+QQNr?S1 z?;xtjUv|*E3}HmuNyB9aFL5H~3Ho0UsmuMZELp1a#CA1g`P{-mT?BchuLEtK}!QZ=3AWakRu~?f9V~3F;TV`5%9Pcs_$gq&CcU}r8gOO zC2&SWPsSG{&o-LIGTBqp6SLQZPvYKp$$7L4WRRZ0BR$Kf0I0SCFkqveCp@f)o8W)! z$%7D1R`&j7W9Q9CGus_)b%+B#J2G;l*FLz#s$hw{BHS~WNLODV#(!u_2Pe&tMsq={ zdm7>_WecWF#D=?eMjLj=-_z`aHMZ=3_-&E8;ibPmM}61i6J3is*=dKf%HC>=xbj4$ zS|Q-hWQ8T5mWde6h@;mS+?k=89?1FU<%qH9B(l&O>k|u_aD|DY*@~(`_pb|B#rJ&g zR0(~(68fpUPz6TdS@4JT5MOPrqDh5_H(eX1$P2SQrkvN8sTxwV>l0)Qq z0pzTuvtEAKRDkKGhhv^jk%|HQ1DdF%5oKq5BS>szk-CIke{%js?~%@$uaN3^Uz6Wf z_iyx{bZ(;9y4X&>LPV=L=d+A}7I4GkK0c1Xts{rrW1Q7apHf-))`BgC^0^F(>At1* za@e7{lq%yAkn*NH8Q1{@{lKhRg*^TfGvv!Sn*ed*x@6>M%aaqySxR|oNadYt1mpUZ z6H(rupHYf&Z z29$5g#|0MX#aR6TZ$@eGxxABRKakDYtD%5BmKp;HbG_ZbT+=81E&=XRk6m_3t9PvD zr5Cqy(v?gHcYvYvXkNH@S#Po~q(_7MOuCAB8G$a9BC##gw^5mW16cML=T=ERL7wsk zzNEayTG?mtB=x*wc@ifBCJ|irFVMOvH)AFRW8WE~U()QT=HBCe@s$dA9O!@`zAAT) zaOZ7l6vyR+Nk_OOF!ZlZmjoImKh)dxFbbR~z(cMhfeX1l7S_`;h|v3gI}n9$sSQ>+3@AFAy9=B_y$)q;Wdl|C-X|VV3w8 z2S#>|5dGA8^9%Bu&fhmVRrTX>Z7{~3V&0UpJNEl0=N32euvDGCJ>#6dUSi&PxFW*s zS`}TB>?}H(T2lxBJ!V#2taV;q%zd6fOr=SGHpoSG*4PDaiG0pdb5`jelVipkEk%FV zThLc@Hc_AL1#D&T4D=w@UezYNJ%0=f3iVRuVL5H?eeZM}4W*bomebEU@e2d`M<~uW zf#Bugwf`VezG|^Qbt6R_=U0}|=k;mIIakz99*>FrsQR{0aQRP6ko?5<7bkDN8evZ& zB@_KqQG?ErKL=1*ZM9_5?Pq%lcS4uLSzN(Mr5=t6xHLS~Ym`UgM@D&VNu8e?_=nSFtF$u@hpPSmI4Vo_t&v?>$~K4y(O~Rb*(MFy_igM7 z*~yYUyR6yQgzWnWMUgDov!!g=lInM+=lOmOk4L`O?{i&qxy&D*_qorRbDwj6?)!ef z#JLd7F6Z2I$S0iYI={rZNk*<{HtIl^mx=h>Cim*04K4+Z4IJtd*-)%6XV2(MCscPiw_a+y*?BKbTS@BZ3AUao^%Zi#PhoY9Vib4N>SE%4>=Jco0v zH_Miey{E;FkdlZSq)e<{`+S3W=*ttvD#hB8w=|2aV*D=yOV}(&p%0LbEWH$&@$X3x~CiF-?ejQ*N+-M zc8zT@3iwkdRT2t(XS`d7`tJQAjRmKAhiw{WOqpuvFp`i@Q@!KMhwKgsA}%@sw8Xo5Y=F zhRJZg)O4uqNWj?V&&vth*H#je6T}}p_<>!Dr#89q@uSjWv~JuW(>FqoJ5^ho0%K?E z9?x_Q;kmcsQ@5=}z@tdljMSt9-Z3xn$k)kEjK|qXS>EfuDmu(Z8|(W?gY6-l z@R_#M8=vxKMAoi&PwnaIYw2COJM@atcgfr=zK1bvjW?9B`-+Voe$Q+H$j!1$Tjn+* z&LY<%)L@;zhnJlB^Og6I&BOR-m?{IW;tyYC%FZ!&Z>kGjHJ6cqM-F z&19n+e1=9AH1VrVeHrIzqlC`w9=*zfmrerF?JMzO&|Mmv;!4DKc(sp+jy^Dx?(8>1 zH&yS_4yL7m&GWX~mdfgH*AB4{CKo;+egw=PrvkTaoBU+P-4u?E|&!c z)DKc;>$$B6u*Zr1SjUh2)FeuWLWHl5TH(UHWkf zLs>7px!c5n;rbe^lO@qlYLzlDVp(z?6rPZel=YB)Uv&n!2{+Mb$-vQl=xKw( zve&>xYx+jW_NJh!FV||r?;hdP*jOXYcLCp>DOtJ?2S^)DkM{{Eb zS$!L$e_o0(^}n3tA1R3-$SNvgBq;DOEo}fNc|tB%%#g4RA3{|euq)p+xd3I8^4E&m zFrD%}nvG^HUAIKe9_{tXB;tl|G<%>yk6R;8L2)KUJw4yHJXUOPM>(-+jxq4R;z8H#>rnJy*)8N+$wA$^F zN+H*3t)eFEgxLw+Nw3};4WV$qj&_D`%ADV2%r zJCPCo%{=z7;`F98(us5JnT(G@sKTZ^;2FVitXyLe-S5(hV&Ium+1pIUB(CZ#h|g)u zSLJJ<@HgrDiA-}V_6B^x1>c9B6%~847JkQ!^KLZ2skm;q*edo;UA)~?SghG8;QbHh z_6M;ouo_1rq9=x$<`Y@EA{C%6-pEV}B(1#sDoe_e1s3^Y>n#1Sw;N|}8D|s|VPd+g z-_$QhCz`vLxxrVMx3ape1xu3*wjx=yKSlM~nFgkNWb4?DDr*!?U)L_VeffF<+!j|b zZ$Wn2$TDv3C3V@BHpSgv3JUif8%hk%OsGZ=OxH@8&4`bbf$`aAMchl^qN>Eyu3JH} z9-S!x8-s4fE=lad%Pkp8hAs~u?|uRnL48O|;*DEU! zuS0{cpk%1E0nc__2%;apFsTm0bKtd&A0~S3Cj^?72-*Owk3V!ZG*PswDfS~}2<8le z5+W^`Y(&R)yVF*tU_s!XMcJS`;(Tr`J0%>p=Z&InR%D3@KEzzI+-2)HK zuoNZ&o=wUC&+*?ofPb0a(E6(<2Amd6%uSu_^-<1?hsxs~0K5^f(LsGqgEF^+0_H=uNk9S0bb!|O8d?m5gQjUKevPaO+*VfSn^2892K~%crWM8+6 z25@V?Y@J<9w%@NXh-2!}SK_(X)O4AM1-WTg>sj1{lj5@=q&dxE^9xng1_z9w9DK>| z6Iybcd0e zyi;Ew!KBRIfGPGytQ6}z}MeXCfLY0?9%RiyagSp_D1?N&c{ zyo>VbJ4Gy`@Fv+5cKgUgs~na$>BV{*em7PU3%lloy_aEovR+J7TfQKh8BJXyL6|P8un-Jnq(ghd!_HEOh$zlv2$~y3krgeH;9zC}V3f`uDtW(%mT#944DQa~^8ZI+zAUu4U(j0YcDfKR$bK#gvn_{JZ>|gZ5+)u?T$w7Q%F^;!Wk?G z(le7r!ufT*cxS}PR6hIVtXa)i`d$-_1KkyBU>qmgz-=T};uxx&sKgv48akIWQ89F{ z0XiY?WM^~;|T8zBOr zs#zuOONzH?svv*jokd5SK8wG>+yMC)LYL|vLqm^PMHcT=`}V$=nIRHe2?h)8WQa6O zPAU}d`1y(>kZiP~Gr=mtJLMu`i<2CspL|q2DqAgAD^7*$xzM`PU4^ga`ilE134XBQ z99P(LhHU@7qvl9Yzg$M`+dlS=x^(m-_3t|h>S}E0bcFMn=C|KamQ)=w2^e)35p`zY zRV8X?d;s^>Cof2SPR&nP3E+-LCkS0J$H!eh8~k0qo$}00b=7!H_I2O+Ro@3O$nPdm ztmbOO^B+IHzQ5w>@@@J4cKw5&^_w6s!s=H%&byAbUtczPQ7}wfTqxxtQNfn*u73Qw zGuWsrky_ajPx-5`R<)6xHf>C(oqGf_Fw|-U*GfS?xLML$kv;h_pZ@Kk$y0X(S+K80 z6^|z)*`5VUkawg}=z`S;VhZhxyDfrE0$(PMurAxl~<>lfZa>JZ288ULK7D` zl9|#L^JL}Y$j*j`0-K6kH#?bRmg#5L3iB4Z)%iF@SqT+Lp|{i`m%R-|ZE94Np7Pa5 zCqC^V3}B(FR340pmF*qaa}M}+h6}mqE~7Sh!9bDv9YRT|>vBNAqv09zXHMlcuhKD| zcjjA(b*XCIwJ33?CB!+;{)vX@9xns_b-VO{i0y?}{!sdXj1GM8+$#v>W7nw;+O_9B z_{4L;C6ol?(?W0<6taGEn1^uG=?Q3i29sE`RfYCaV$3DKc_;?HsL?D_fSYg}SuO5U zOB_f4^vZ_x%o`5|C@9C5+o=mFy@au{s)sKw!UgC&L35aH(sgDxRE2De%(%OT=VUdN ziVLEmdOvJ&5*tCMKRyXctCwQu_RH%;m*$YK&m;jtbdH#Ak~13T1^f89tn`A%QEHWs~jnY~E}p_Z$XC z=?YXLCkzVSK+Id`xZYTegb@W8_baLt-Fq`Tv|=)JPbFsKRm)4UW;yT+J`<)%#ue9DPOkje)YF2fsCilK9MIIK>p*`fkoD5nGfmLwt)!KOT+> zOFq*VZktDDyM3P5UOg`~XL#cbzC}eL%qMB=Q5$d89MKuN#$6|4gx_Jt0Gfn8w&q}%lq4QU%6#jT*MRT% zrLz~C8FYKHawn-EQWN1B75O&quS+Z81(zN)G>~vN8VwC+e+y(`>HcxC{MrJ;H1Z4k zZWuv$w_F0-Ub%MVcpIc){4PGL^I7M{>;hS?;eH!;gmcOE66z3;Z1Phqo(t zVP(Hg6q#0gIKgsg7L7WE!{Y#1nI(45tx2{$34dDd#!Z0NIyrm)HOn5W#7;f4pQci# zDW!FI(g4e668kI9{2+mLwB+=#9bfqgX%!B34V-$wwSN(_cm*^{y0jQtv*4}eO^sOV z*9xoNvX)c9isB}Tgx&ZRjp3kwhTVK?r9;n!x>^XYT z@Q^7zp{rkIs{2mUSE^2!Gf6$6;j~&4=-0cSJJDizZp6LTe8b45;{AKM%v99}{{FfC zz709%u0mC=1KXTo(=TqmZQ;c?$M3z(!xah>aywrj40sc2y3rKFw4jCq+Y+u=CH@_V zxz|qeTwa>+<|H%8Dz5u>ZI5MmjTFwXS-Fv!TDd*`>3{krWoNVx$<133`(ftS?ZPyY z&4@ah^3^i`vL$BZa>O|Nt?ucewzsF)0zX3qmM^|waXr=T0pfIb0*$AwU=?Ipl|1Y; z*Pk6{C-p4MY;j@IJ|DW>QHZQJcp;Z~?8(Q+Kk3^0qJ}SCk^*n4W zu9ZFwLHUx-$6xvaQ)SUQcYd6fF8&x)V`1bIuX@>{mE$b|Yd(qomn3;bPwnDUc0F=; zh*6_((%bqAYQWQ~odER?h>1mkL4kpb3s7`0m@rDKGU*oyF)$j~Ffd4fXV$?`f~rHf zB%Y)@5SXZvfwm10RY5X?TEo)PK_`L6qgBp=#>fO49$D zDq8Ozj0q6213tV5Qq=;fZ0$|KroY{Dz=l@lU^J)?Ko@ti20TRplXzphBi>XGx4bou zEWrkNjz0t5j!_ke{g5I#PUlEU$Km8g8TE|XK=MkU@PT4T><2OVamoK;wJ}3X0L$vX zgd7gNa359*nc)R-0!`2X@FOTB`+oETOPc=ubp5R)VQgY+5BTZZJ2?9QwnO=dnulIUF3gFn;BODC2)65)HeVd%t86sL7Rv^Y+nbn+&l z6BAJY(ETvwI)Ts$aiE8rht4KD*qNyE{8{x6R|%akbTBzw;2+6Echkt+W+`u^XX z_z&x%n '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/utils/sdk/client/java/gradlew.bat b/utils/sdk/client/java/gradlew.bat new file mode 100644 index 00000000..25da30db --- /dev/null +++ b/utils/sdk/client/java/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/utils/sdk/client/java/pom.xml b/utils/sdk/client/java/pom.xml new file mode 100644 index 00000000..083de649 --- /dev/null +++ b/utils/sdk/client/java/pom.xml @@ -0,0 +1,340 @@ + + 4.0.0 + letheanVPN + lthn + jar + lthn + 6.0.1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + EUPL-1.2 + https://joinup.ec.europa.eu/software/page/eupl/licence-eupl + repo + + + + + + Lethean Community + support@lt.hn + letheanVPN + https://lt.hn + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.6.1 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.5.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.3 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.9.0 + 4.12.0 + 2.10.1 + 3.18.0 + 0.2.7 + 1.3.5 + 2.0.2 + 5.10.3 + 1.10.0 + 2.1.6 + 1.1.1 + UTF-8 + 2.43.0 + + diff --git a/utils/sdk/client/java/settings.gradle b/utils/sdk/client/java/settings.gradle new file mode 100644 index 00000000..9f0a9c57 --- /dev/null +++ b/utils/sdk/client/java/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "lthn" \ No newline at end of file diff --git a/utils/sdk/client/java/src/main/AndroidManifest.xml b/utils/sdk/client/java/src/main/AndroidManifest.xml new file mode 100644 index 00000000..fecb8b40 --- /dev/null +++ b/utils/sdk/client/java/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ApiCallback.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiCallback.java new file mode 100644 index 00000000..03fcea48 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ApiClient.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiClient.java new file mode 100644 index 00000000..9501f117 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiClient.java @@ -0,0 +1,1592 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import invalidPackageName.auth.Authentication; +import invalidPackageName.auth.HttpBasicAuth; +import invalidPackageName.auth.HttpBearerAuth; +import invalidPackageName.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + protected String basePath = "http://127.0.0.1:36943"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://127.0.0.1:36943", + "Local Daemon", + new HashMap() + ), + new ServerConfiguration( + "http://seed.lethean.io:36943", + "Seed Server", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected boolean debugging = false; + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String tempFolderPath = null; + + protected Map authentications; + + protected DateFormat dateFormat; + protected DateFormat datetimeFormat; + protected boolean lenientDatetimeFormat; + protected int dateLength; + + protected InputStream sslCaCert; + protected boolean verifyingSsl; + protected KeyManager[] keyManagers; + + protected OkHttpClient httpClient; + protected JSON json; + + protected HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + protected void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + protected void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + protected void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/6.0.1/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g http://127.0.0.1:36943) + * @return An instance of ApiClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return ApiClient + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link invalidPackageName.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link invalidPackageName.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link invalidPackageName.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link invalidPackageName.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link invalidPackageName.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceFirst("^.*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws invalidPackageName.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + ResponseBody respBody = response.body(); + if (respBody == null) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + try { + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody.byteStream(), returnType); + } else if (returnType.equals(String.class)) { + String respBodyString = respBody.string(); + if (respBodyString.isEmpty()) { + return null; + } + // Expecting string, return the raw response body. + return (T) respBodyString; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + response.body().string()); + } + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws invalidPackageName.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws invalidPackageName.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws invalidPackageName.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws invalidPackageName.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws invalidPackageName.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws invalidPackageName.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws invalidPackageName.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + List updatedQueryParams = new ArrayList<>(queryParams); + + // update parameters with authentication settings + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + Locale.ROOT, + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format(Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format(Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws invalidPackageName.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + protected Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + protected void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + protected KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws invalidPackageName.ApiException If fail to serialize the request body object into a string + */ + protected String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ApiException.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiException.java new file mode 100644 index 00000000..efa0adf0 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiException.java @@ -0,0 +1,168 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import java.util.Map; +import java.util.List; +import java.util.Locale; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format(Locale.ROOT, "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ApiResponse.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiResponse.java new file mode 100644 index 00000000..a2982a72 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/Configuration.java b/utils/sdk/client/java/src/main/java/invalidPackageName/Configuration.java new file mode 100644 index 00000000..41433308 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/Configuration.java @@ -0,0 +1,63 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class Configuration { + public static final String VERSION = "6.0.1"; + + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; + + /** + * Get the default API client, which would be used when creating API instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = defaultApiClient.updateAndGet(val -> { + if (val != null) { // changed by another thread + return val; + } + return apiClientFactory.get(); + }); + } + return client; + } + + /** + * Set the default API client, which would be used when creating API instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } + + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() { + } +} \ No newline at end of file diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/GzipRequestInterceptor.java b/utils/sdk/client/java/src/main/java/invalidPackageName/GzipRequestInterceptor.java new file mode 100644 index 00000000..2601e5ba --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/JSON.java b/utils/sdk/client/java/src/main/java/invalidPackageName/JSON.java new file mode 100644 index 00000000..283f18b9 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/JSON.java @@ -0,0 +1,446 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockDetailsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockProcessingPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DbStatInfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HeightModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MaintainersInfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PosEntryModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionAttachmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionDetailsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionExtraModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionInputModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionOutputModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxGenerationContextModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxPoolPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxProcessingPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VersionModel.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Deserialize the given JSON InputStream to a Java object. + * + * @param Type + * @param inputStream The JSON InputStream + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(InputStream inputStream, Type returnType) throws IOException { + try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { + if (isLenientOnJson) { + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + JsonReader jsonReader = new JsonReader(reader); + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(reader, returnType); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/Pair.java b/utils/sdk/client/java/src/main/java/invalidPackageName/Pair.java new file mode 100644 index 00000000..7aff7ba5 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/Pair.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class Pair { + private final String name; + private final String value; + + public Pair(String name, String value) { + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private static boolean isValidString(String arg) { + return arg != null; + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressRequestBody.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressRequestBody.java new file mode 100644 index 00000000..017534b1 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressResponseBody.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressResponseBody.java new file mode 100644 index 00000000..dda8e80a --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ServerConfiguration.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerConfiguration.java new file mode 100644 index 00000000..49a1823e --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ServerVariable.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerVariable.java new file mode 100644 index 00000000..c1c27ffe --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/StringUtil.java b/utils/sdk/client/java/src/main/java/invalidPackageName/StringUtil.java new file mode 100644 index 00000000..e395bb59 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/ApiKeyAuth.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/ApiKeyAuth.java new file mode 100644 index 00000000..7a86627f --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName.auth; + +import invalidPackageName.ApiException; +import invalidPackageName.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/Authentication.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/Authentication.java new file mode 100644 index 00000000..7db9dcf9 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/Authentication.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName.auth; + +import invalidPackageName.Pair; +import invalidPackageName.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBasicAuth.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBasicAuth.java new file mode 100644 index 00000000..eb8d81a5 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName.auth; + +import invalidPackageName.Pair; +import invalidPackageName.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBearerAuth.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBearerAuth.java new file mode 100644 index 00000000..ff90ba05 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package invalidPackageName.auth; + +import invalidPackageName.ApiException; +import invalidPackageName.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/utils/sdk/client/java/src/main/java/lthn/BlockApi.java b/utils/sdk/client/java/src/main/java/lthn/BlockApi.java new file mode 100644 index 00000000..8cf77f2d --- /dev/null +++ b/utils/sdk/client/java/src/main/java/lthn/BlockApi.java @@ -0,0 +1,727 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package lthn; + +import invalidPackageName.ApiCallback; +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.ApiResponse; +import invalidPackageName.Configuration; +import invalidPackageName.Pair; +import invalidPackageName.ProgressRequestBody; +import invalidPackageName.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.BlockDetailsModel; +import org.openapitools.client.model.BlockTemplateModel; +import org.openapitools.client.model.BlockTemplateRequestModel; +import org.openapitools.client.model.HeightModel; +import org.openapitools.client.model.SubmitBlockRequestModel; +import org.openapitools.client.model.SubmitBlockResponseModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class BlockApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public BlockApi() { + this(Configuration.getDefaultApiClient()); + } + + public BlockApi(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 createBlockTemplate + * @param blockTemplateRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
500 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call createBlockTemplateCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = blockTemplateRequestModel; + + // create path and map variables + String localVarPath = "/block/template"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBlockTemplateValidateBeforeCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'blockTemplateRequestModel' is set + if (blockTemplateRequestModel == null) { + throw new ApiException("Missing the required parameter 'blockTemplateRequestModel' when calling createBlockTemplate(Async)"); + } + + return createBlockTemplateCall(blockTemplateRequestModel, _callback); + + } + + /** + * Create a block template for mining + * + * @param blockTemplateRequestModel (required) + * @return BlockTemplateModel + * @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
500 text/plain -
400 text/plain -
200 OK -
+ */ + public BlockTemplateModel createBlockTemplate(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException { + ApiResponse localVarResp = createBlockTemplateWithHttpInfo(blockTemplateRequestModel); + return localVarResp.getData(); + } + + /** + * Create a block template for mining + * + * @param blockTemplateRequestModel (required) + * @return ApiResponse<BlockTemplateModel> + * @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
500 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse createBlockTemplateWithHttpInfo(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException { + okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a block template for mining (asynchronously) + * + * @param blockTemplateRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
500 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call createBlockTemplateAsync(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlock + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
404 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call getBlockCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/block/{identifier}" + .replace("{" + "identifier" + "}", localVarApiClient.escapeString(identifier.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlockValidateBeforeCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException("Missing the required parameter 'identifier' when calling getBlock(Async)"); + } + + return getBlockCall(identifier, _callback); + + } + + /** + * Get a block by its hash or height (ID) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @return BlockDetailsModel + * @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
404 text/plain -
400 text/plain -
200 OK -
+ */ + public BlockDetailsModel getBlock(@javax.annotation.Nonnull String identifier) throws ApiException { + ApiResponse localVarResp = getBlockWithHttpInfo(identifier); + return localVarResp.getData(); + } + + /** + * Get a block by its hash or height (ID) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @return ApiResponse<BlockDetailsModel> + * @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
404 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse getBlockWithHttpInfo(@javax.annotation.Nonnull String identifier) throws ApiException { + okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a block by its hash or height (ID) (asynchronously) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
404 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call getBlockAsync(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlocks + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public okhttp3.Call getBlocksCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/block"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlocksValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getBlocksCall(_callback); + + } + + /** + * Get one or more blocks, with optional pagination. + * + * @return List<BlockDetailsModel> + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public List getBlocks() throws ApiException { + ApiResponse> localVarResp = getBlocksWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get one or more blocks, with optional pagination. + * + * @return ApiResponse<List<BlockDetailsModel>> + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public ApiResponse> getBlocksWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getBlocksValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get one or more blocks, with optional pagination. (asynchronously) + * + * @param _callback The callback to be executed when the API call 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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public okhttp3.Call getBlocksAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlocksValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getHeight + * @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 -
+ */ + public okhttp3.Call getHeightCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/block/height"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getHeightValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getHeightCall(_callback); + + } + + /** + * Get the current blockchain height + * + * @return HeightModel + * @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 -
+ */ + public HeightModel getHeight() throws ApiException { + ApiResponse localVarResp = getHeightWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the current blockchain height + * + * @return ApiResponse<HeightModel> + * @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 -
+ */ + public ApiResponse getHeightWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getHeightValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the current blockchain height (asynchronously) + * + * @param _callback The callback to be executed when the API call 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 -
+ */ + public okhttp3.Call getHeightAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getHeightValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for submitBlock + * @param submitBlockRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
406 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call submitBlockCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = submitBlockRequestModel; + + // create path and map variables + String localVarPath = "/block/submit"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitBlockValidateBeforeCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'submitBlockRequestModel' is set + if (submitBlockRequestModel == null) { + throw new ApiException("Missing the required parameter 'submitBlockRequestModel' when calling submitBlock(Async)"); + } + + return submitBlockCall(submitBlockRequestModel, _callback); + + } + + /** + * Submit a new block to the network + * + * @param submitBlockRequestModel (required) + * @return SubmitBlockResponseModel + * @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
406 text/plain -
400 text/plain -
200 OK -
+ */ + public SubmitBlockResponseModel submitBlock(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException { + ApiResponse localVarResp = submitBlockWithHttpInfo(submitBlockRequestModel); + return localVarResp.getData(); + } + + /** + * Submit a new block to the network + * + * @param submitBlockRequestModel (required) + * @return ApiResponse<SubmitBlockResponseModel> + * @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
406 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse submitBlockWithHttpInfo(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException { + okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Submit a new block to the network (asynchronously) + * + * @param submitBlockRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
406 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call submitBlockAsync(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/utils/sdk/client/java/src/main/java/lthn/InfoApi.java b/utils/sdk/client/java/src/main/java/lthn/InfoApi.java new file mode 100644 index 00000000..dec1ccb5 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/lthn/InfoApi.java @@ -0,0 +1,318 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package lthn; + +import invalidPackageName.ApiCallback; +import invalidPackageName.ApiClient; +import invalidPackageName.ApiException; +import invalidPackageName.ApiResponse; +import invalidPackageName.Configuration; +import invalidPackageName.Pair; +import invalidPackageName.ProgressRequestBody; +import invalidPackageName.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.InfoModel; +import org.openapitools.client.model.VersionModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InfoApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InfoApi() { + this(Configuration.getDefaultApiClient()); + } + + public InfoApi(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 getInfo + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getInfoCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/info"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (flags != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("flags", flags)); + } + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInfoValidateBeforeCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + return getInfoCall(flags, _callback); + + } + + /** + * Get detailed information about the blockchain and daemon state + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @return InfoModel + * @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 -
+ */ + public InfoModel getInfo(@javax.annotation.Nullable String flags) throws ApiException { + ApiResponse localVarResp = getInfoWithHttpInfo(flags); + return localVarResp.getData(); + } + + /** + * Get detailed information about the blockchain and daemon state + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @return ApiResponse<InfoModel> + * @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 -
+ */ + public ApiResponse getInfoWithHttpInfo(@javax.annotation.Nullable String flags) throws ApiException { + okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get detailed information about the blockchain and daemon state (asynchronously) + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getInfoAsync(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for version + * @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 -
+ */ + public okhttp3.Call versionCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/info/version"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call versionValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return versionCall(_callback); + + } + + /** + * Get API version + * Returns the current version of the API. + * @return VersionModel + * @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 -
+ */ + public VersionModel version() throws ApiException { + ApiResponse localVarResp = versionWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get API version + * Returns the current version of the API. + * @return ApiResponse<VersionModel> + * @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 -
+ */ + public ApiResponse versionWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = versionValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get API version (asynchronously) + * Returns the current version of the API. + * @param _callback The callback to be executed when the API call 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 -
+ */ + public okhttp3.Call versionAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = versionValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ApiCallback.java b/utils/sdk/client/java/src/main/java/org/lthn/ApiCallback.java new file mode 100644 index 00000000..2aeedc6f --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ApiClient.java b/utils/sdk/client/java/src/main/java/org/lthn/ApiClient.java new file mode 100644 index 00000000..8b9d4fe1 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ApiClient.java @@ -0,0 +1,1592 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.lthn.auth.Authentication; +import org.lthn.auth.HttpBasicAuth; +import org.lthn.auth.HttpBearerAuth; +import org.lthn.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + protected String basePath = "http://127.0.0.1:36943"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://127.0.0.1:36943", + "Local Daemon", + new HashMap() + ), + new ServerConfiguration( + "http://seed.lethean.io:36943", + "Seed Server", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected boolean debugging = false; + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String tempFolderPath = null; + + protected Map authentications; + + protected DateFormat dateFormat; + protected DateFormat datetimeFormat; + protected boolean lenientDatetimeFormat; + protected int dateLength; + + protected InputStream sslCaCert; + protected boolean verifyingSsl; + protected KeyManager[] keyManagers; + + protected OkHttpClient httpClient; + protected JSON json; + + protected HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + protected void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + protected void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + protected void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/6.0.1/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g http://127.0.0.1:36943) + * @return An instance of ApiClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return ApiClient + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.lthn.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.lthn.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.lthn.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.lthn.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link org.lthn.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceFirst("^.*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws org.lthn.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + ResponseBody respBody = response.body(); + if (respBody == null) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + try { + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody.byteStream(), returnType); + } else if (returnType.equals(String.class)) { + String respBodyString = respBody.string(); + if (respBodyString.isEmpty()) { + return null; + } + // Expecting string, return the raw response body. + return (T) respBodyString; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + response.body().string()); + } + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws org.lthn.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws org.lthn.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws org.lthn.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws org.lthn.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws org.lthn.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws org.lthn.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws org.lthn.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + List updatedQueryParams = new ArrayList<>(queryParams); + + // update parameters with authentication settings + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + Locale.ROOT, + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format(Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format(Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws org.lthn.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + protected Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + protected void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + protected KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.lthn.ApiException If fail to serialize the request body object into a string + */ + protected String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ApiException.java b/utils/sdk/client/java/src/main/java/org/lthn/ApiException.java new file mode 100644 index 00000000..cb1ad3ae --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ApiException.java @@ -0,0 +1,168 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import java.util.Map; +import java.util.List; +import java.util.Locale; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format(Locale.ROOT, "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ApiResponse.java b/utils/sdk/client/java/src/main/java/org/lthn/ApiResponse.java new file mode 100644 index 00000000..9c465cb7 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/Configuration.java b/utils/sdk/client/java/src/main/java/org/lthn/Configuration.java new file mode 100644 index 00000000..0043f426 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/Configuration.java @@ -0,0 +1,63 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class Configuration { + public static final String VERSION = "6.0.1"; + + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; + + /** + * Get the default API client, which would be used when creating API instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = defaultApiClient.updateAndGet(val -> { + if (val != null) { // changed by another thread + return val; + } + return apiClientFactory.get(); + }); + } + return client; + } + + /** + * Set the default API client, which would be used when creating API instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } + + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() { + } +} \ No newline at end of file diff --git a/utils/sdk/client/java/src/main/java/org/lthn/GzipRequestInterceptor.java b/utils/sdk/client/java/src/main/java/org/lthn/GzipRequestInterceptor.java new file mode 100644 index 00000000..24b540dc --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/JSON.java b/utils/sdk/client/java/src/main/java/org/lthn/JSON.java new file mode 100644 index 00000000..ea097389 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/JSON.java @@ -0,0 +1,446 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockDetailsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockProcessingPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DbStatInfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HeightModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MaintainersInfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PosEntryModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionAttachmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionDetailsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionExtraModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionInputModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionOutputModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxGenerationContextModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxPoolPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxProcessingPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VersionModel.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Deserialize the given JSON InputStream to a Java object. + * + * @param Type + * @param inputStream The JSON InputStream + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(InputStream inputStream, Type returnType) throws IOException { + try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { + if (isLenientOnJson) { + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + JsonReader jsonReader = new JsonReader(reader); + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(reader, returnType); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/Pair.java b/utils/sdk/client/java/src/main/java/org/lthn/Pair.java new file mode 100644 index 00000000..085be9a1 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/Pair.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class Pair { + private final String name; + private final String value; + + public Pair(String name, String value) { + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private static boolean isValidString(String arg) { + return arg != null; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ProgressRequestBody.java b/utils/sdk/client/java/src/main/java/org/lthn/ProgressRequestBody.java new file mode 100644 index 00000000..7a9320e4 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ProgressResponseBody.java b/utils/sdk/client/java/src/main/java/org/lthn/ProgressResponseBody.java new file mode 100644 index 00000000..74a82c5b --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ServerConfiguration.java b/utils/sdk/client/java/src/main/java/org/lthn/ServerConfiguration.java new file mode 100644 index 00000000..c3729842 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ServerVariable.java b/utils/sdk/client/java/src/main/java/org/lthn/ServerVariable.java new file mode 100644 index 00000000..b6d6a830 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/StringUtil.java b/utils/sdk/client/java/src/main/java/org/lthn/StringUtil.java new file mode 100644 index 00000000..ecb088b3 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/api/BlockApi.java b/utils/sdk/client/java/src/main/java/org/lthn/api/BlockApi.java new file mode 100644 index 00000000..12ef5d59 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/api/BlockApi.java @@ -0,0 +1,727 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.api; + +import org.lthn.ApiCallback; +import org.lthn.ApiClient; +import org.lthn.ApiException; +import org.lthn.ApiResponse; +import org.lthn.Configuration; +import org.lthn.Pair; +import org.lthn.ProgressRequestBody; +import org.lthn.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.BlockDetailsModel; +import org.openapitools.client.model.BlockTemplateModel; +import org.openapitools.client.model.BlockTemplateRequestModel; +import org.openapitools.client.model.HeightModel; +import org.openapitools.client.model.SubmitBlockRequestModel; +import org.openapitools.client.model.SubmitBlockResponseModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class BlockApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public BlockApi() { + this(Configuration.getDefaultApiClient()); + } + + public BlockApi(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 createBlockTemplate + * @param blockTemplateRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
500 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call createBlockTemplateCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = blockTemplateRequestModel; + + // create path and map variables + String localVarPath = "/block/template"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBlockTemplateValidateBeforeCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'blockTemplateRequestModel' is set + if (blockTemplateRequestModel == null) { + throw new ApiException("Missing the required parameter 'blockTemplateRequestModel' when calling createBlockTemplate(Async)"); + } + + return createBlockTemplateCall(blockTemplateRequestModel, _callback); + + } + + /** + * Create a block template for mining + * + * @param blockTemplateRequestModel (required) + * @return BlockTemplateModel + * @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
500 text/plain -
400 text/plain -
200 OK -
+ */ + public BlockTemplateModel createBlockTemplate(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException { + ApiResponse localVarResp = createBlockTemplateWithHttpInfo(blockTemplateRequestModel); + return localVarResp.getData(); + } + + /** + * Create a block template for mining + * + * @param blockTemplateRequestModel (required) + * @return ApiResponse<BlockTemplateModel> + * @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
500 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse createBlockTemplateWithHttpInfo(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException { + okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a block template for mining (asynchronously) + * + * @param blockTemplateRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
500 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call createBlockTemplateAsync(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlock + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
404 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call getBlockCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/block/{identifier}" + .replace("{" + "identifier" + "}", localVarApiClient.escapeString(identifier.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlockValidateBeforeCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException("Missing the required parameter 'identifier' when calling getBlock(Async)"); + } + + return getBlockCall(identifier, _callback); + + } + + /** + * Get a block by its hash or height (ID) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @return BlockDetailsModel + * @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
404 text/plain -
400 text/plain -
200 OK -
+ */ + public BlockDetailsModel getBlock(@javax.annotation.Nonnull String identifier) throws ApiException { + ApiResponse localVarResp = getBlockWithHttpInfo(identifier); + return localVarResp.getData(); + } + + /** + * Get a block by its hash or height (ID) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @return ApiResponse<BlockDetailsModel> + * @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
404 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse getBlockWithHttpInfo(@javax.annotation.Nonnull String identifier) throws ApiException { + okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a block by its hash or height (ID) (asynchronously) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
404 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call getBlockAsync(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlocks + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public okhttp3.Call getBlocksCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/block"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlocksValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getBlocksCall(_callback); + + } + + /** + * Get one or more blocks, with optional pagination. + * + * @return List<BlockDetailsModel> + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public List getBlocks() throws ApiException { + ApiResponse> localVarResp = getBlocksWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get one or more blocks, with optional pagination. + * + * @return ApiResponse<List<BlockDetailsModel>> + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public ApiResponse> getBlocksWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getBlocksValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get one or more blocks, with optional pagination. (asynchronously) + * + * @param _callback The callback to be executed when the API call 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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public okhttp3.Call getBlocksAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlocksValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getHeight + * @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 -
+ */ + public okhttp3.Call getHeightCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/block/height"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getHeightValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getHeightCall(_callback); + + } + + /** + * Get the current blockchain height + * + * @return HeightModel + * @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 -
+ */ + public HeightModel getHeight() throws ApiException { + ApiResponse localVarResp = getHeightWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the current blockchain height + * + * @return ApiResponse<HeightModel> + * @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 -
+ */ + public ApiResponse getHeightWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getHeightValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the current blockchain height (asynchronously) + * + * @param _callback The callback to be executed when the API call 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 -
+ */ + public okhttp3.Call getHeightAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getHeightValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for submitBlock + * @param submitBlockRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
406 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call submitBlockCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = submitBlockRequestModel; + + // create path and map variables + String localVarPath = "/block/submit"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitBlockValidateBeforeCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'submitBlockRequestModel' is set + if (submitBlockRequestModel == null) { + throw new ApiException("Missing the required parameter 'submitBlockRequestModel' when calling submitBlock(Async)"); + } + + return submitBlockCall(submitBlockRequestModel, _callback); + + } + + /** + * Submit a new block to the network + * + * @param submitBlockRequestModel (required) + * @return SubmitBlockResponseModel + * @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
406 text/plain -
400 text/plain -
200 OK -
+ */ + public SubmitBlockResponseModel submitBlock(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException { + ApiResponse localVarResp = submitBlockWithHttpInfo(submitBlockRequestModel); + return localVarResp.getData(); + } + + /** + * Submit a new block to the network + * + * @param submitBlockRequestModel (required) + * @return ApiResponse<SubmitBlockResponseModel> + * @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
406 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse submitBlockWithHttpInfo(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException { + okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Submit a new block to the network (asynchronously) + * + * @param submitBlockRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
406 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call submitBlockAsync(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/api/InfoApi.java b/utils/sdk/client/java/src/main/java/org/lthn/api/InfoApi.java new file mode 100644 index 00000000..6af5e781 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/api/InfoApi.java @@ -0,0 +1,318 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.api; + +import org.lthn.ApiCallback; +import org.lthn.ApiClient; +import org.lthn.ApiException; +import org.lthn.ApiResponse; +import org.lthn.Configuration; +import org.lthn.Pair; +import org.lthn.ProgressRequestBody; +import org.lthn.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.InfoModel; +import org.openapitools.client.model.VersionModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InfoApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InfoApi() { + this(Configuration.getDefaultApiClient()); + } + + public InfoApi(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 getInfo + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getInfoCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/info"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (flags != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("flags", flags)); + } + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInfoValidateBeforeCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + return getInfoCall(flags, _callback); + + } + + /** + * Get detailed information about the blockchain and daemon state + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @return InfoModel + * @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 -
+ */ + public InfoModel getInfo(@javax.annotation.Nullable String flags) throws ApiException { + ApiResponse localVarResp = getInfoWithHttpInfo(flags); + return localVarResp.getData(); + } + + /** + * Get detailed information about the blockchain and daemon state + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @return ApiResponse<InfoModel> + * @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 -
+ */ + public ApiResponse getInfoWithHttpInfo(@javax.annotation.Nullable String flags) throws ApiException { + okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get detailed information about the blockchain and daemon state (asynchronously) + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getInfoAsync(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for version + * @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 -
+ */ + public okhttp3.Call versionCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/info/version"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call versionValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return versionCall(_callback); + + } + + /** + * Get API version + * Returns the current version of the API. + * @return VersionModel + * @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 -
+ */ + public VersionModel version() throws ApiException { + ApiResponse localVarResp = versionWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get API version + * Returns the current version of the API. + * @return ApiResponse<VersionModel> + * @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 -
+ */ + public ApiResponse versionWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = versionValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get API version (asynchronously) + * Returns the current version of the API. + * @param _callback The callback to be executed when the API call 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 -
+ */ + public okhttp3.Call versionAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = versionValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/auth/ApiKeyAuth.java b/utils/sdk/client/java/src/main/java/org/lthn/auth/ApiKeyAuth.java new file mode 100644 index 00000000..f03fced2 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.auth; + +import org.lthn.ApiException; +import org.lthn.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/auth/Authentication.java b/utils/sdk/client/java/src/main/java/org/lthn/auth/Authentication.java new file mode 100644 index 00000000..9dcc53ca --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/auth/Authentication.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.auth; + +import org.lthn.Pair; +import org.lthn.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBasicAuth.java b/utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBasicAuth.java new file mode 100644 index 00000000..f3b8744b --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.auth; + +import org.lthn.Pair; +import org.lthn.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBearerAuth.java b/utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBearerAuth.java new file mode 100644 index 00000000..06d19598 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/lthn/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.auth; + +import org.lthn.ApiException; +import org.lthn.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiCallback.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000..87e9d25a --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiClient.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000..4905eb18 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1592 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + protected String basePath = "http://127.0.0.1:36943"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://127.0.0.1:36943", + "Local Daemon", + new HashMap() + ), + new ServerConfiguration( + "http://seed.lethean.io:36943", + "Seed Server", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected boolean debugging = false; + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String tempFolderPath = null; + + protected Map authentications; + + protected DateFormat dateFormat; + protected DateFormat datetimeFormat; + protected boolean lenientDatetimeFormat; + protected int dateLength; + + protected InputStream sslCaCert; + protected boolean verifyingSsl; + protected KeyManager[] keyManagers; + + protected OkHttpClient httpClient; + protected JSON json; + + protected HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + protected void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + protected void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + protected void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/6.0.1/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g http://127.0.0.1:36943) + * @return An instance of ApiClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return ApiClient + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceFirst("^.*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + ResponseBody respBody = response.body(); + if (respBody == null) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + try { + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody.byteStream(), returnType); + } else if (returnType.equals(String.class)) { + String respBodyString = respBody.string(); + if (respBodyString.isEmpty()) { + return null; + } + // Expecting string, return the raw response body. + return (T) respBodyString; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + response.body().string()); + } + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws org.openapitools.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + List updatedQueryParams = new ArrayList<>(queryParams); + + // update parameters with authentication settings + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + Locale.ROOT, + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format(Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format(Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + protected Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + protected void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + protected KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + protected String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiException.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000..9bbc1a99 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,168 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Map; +import java.util.List; +import java.util.Locale; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format(Locale.ROOT, "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiResponse.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000..33e5bdf0 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/Configuration.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000..ea06f1bb --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,63 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class Configuration { + public static final String VERSION = "6.0.1"; + + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; + + /** + * Get the default API client, which would be used when creating API instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = defaultApiClient.updateAndGet(val -> { + if (val != null) { // changed by another thread + return val; + } + return apiClientFactory.get(); + }); + } + return client; + } + + /** + * Set the default API client, which would be used when creating API instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } + + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() { + } +} \ No newline at end of file diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000..578bce6b --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/JSON.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000..dd71f137 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,446 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockDetailsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockProcessingPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DbStatInfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HeightModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MaintainersInfoModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PosEntryModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionAttachmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionDetailsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionExtraModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionInputModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionOutputModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxGenerationContextModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxPoolPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxProcessingPerformanceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VersionModel.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Deserialize the given JSON InputStream to a Java object. + * + * @param Type + * @param inputStream The JSON InputStream + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(InputStream inputStream, Type returnType) throws IOException { + try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { + if (isLenientOnJson) { + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + JsonReader jsonReader = new JsonReader(reader); + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(reader, returnType); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/Pair.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000..f1d44191 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class Pair { + private final String name; + private final String value; + + public Pair(String name, String value) { + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private static boolean isValidString(String arg) { + return arg != null; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressRequestBody.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000..d933bacc --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressResponseBody.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000..3e991aab --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ServerConfiguration.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000..2934ac3f --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/ServerVariable.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000..9e06d679 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/StringUtil.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000..b3350b42 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/api/BlockApi.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/api/BlockApi.java new file mode 100644 index 00000000..1fe1468d --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/api/BlockApi.java @@ -0,0 +1,727 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.BlockDetailsModel; +import org.openapitools.client.model.BlockTemplateModel; +import org.openapitools.client.model.BlockTemplateRequestModel; +import org.openapitools.client.model.HeightModel; +import org.openapitools.client.model.SubmitBlockRequestModel; +import org.openapitools.client.model.SubmitBlockResponseModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class BlockApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public BlockApi() { + this(Configuration.getDefaultApiClient()); + } + + public BlockApi(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 createBlockTemplate + * @param blockTemplateRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
500 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call createBlockTemplateCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = blockTemplateRequestModel; + + // create path and map variables + String localVarPath = "/block/template"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBlockTemplateValidateBeforeCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'blockTemplateRequestModel' is set + if (blockTemplateRequestModel == null) { + throw new ApiException("Missing the required parameter 'blockTemplateRequestModel' when calling createBlockTemplate(Async)"); + } + + return createBlockTemplateCall(blockTemplateRequestModel, _callback); + + } + + /** + * Create a block template for mining + * + * @param blockTemplateRequestModel (required) + * @return BlockTemplateModel + * @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
500 text/plain -
400 text/plain -
200 OK -
+ */ + public BlockTemplateModel createBlockTemplate(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException { + ApiResponse localVarResp = createBlockTemplateWithHttpInfo(blockTemplateRequestModel); + return localVarResp.getData(); + } + + /** + * Create a block template for mining + * + * @param blockTemplateRequestModel (required) + * @return ApiResponse<BlockTemplateModel> + * @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
500 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse createBlockTemplateWithHttpInfo(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException { + okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a block template for mining (asynchronously) + * + * @param blockTemplateRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
500 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call createBlockTemplateAsync(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlock + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
404 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call getBlockCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/block/{identifier}" + .replace("{" + "identifier" + "}", localVarApiClient.escapeString(identifier.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlockValidateBeforeCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException("Missing the required parameter 'identifier' when calling getBlock(Async)"); + } + + return getBlockCall(identifier, _callback); + + } + + /** + * Get a block by its hash or height (ID) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @return BlockDetailsModel + * @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
404 text/plain -
400 text/plain -
200 OK -
+ */ + public BlockDetailsModel getBlock(@javax.annotation.Nonnull String identifier) throws ApiException { + ApiResponse localVarResp = getBlockWithHttpInfo(identifier); + return localVarResp.getData(); + } + + /** + * Get a block by its hash or height (ID) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @return ApiResponse<BlockDetailsModel> + * @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
404 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse getBlockWithHttpInfo(@javax.annotation.Nonnull String identifier) throws ApiException { + okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a block by its hash or height (ID) (asynchronously) + * + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
404 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call getBlockAsync(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlocks + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public okhttp3.Call getBlocksCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/block"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlocksValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getBlocksCall(_callback); + + } + + /** + * Get one or more blocks, with optional pagination. + * + * @return List<BlockDetailsModel> + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public List getBlocks() throws ApiException { + ApiResponse> localVarResp = getBlocksWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get one or more blocks, with optional pagination. + * + * @return ApiResponse<List<BlockDetailsModel>> + * @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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public ApiResponse> getBlocksWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getBlocksValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get one or more blocks, with optional pagination. (asynchronously) + * + * @param _callback The callback to be executed when the API call 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
404 text/plain -
400 text/plain -
200 A list of block objects. -
+ */ + public okhttp3.Call getBlocksAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlocksValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getHeight + * @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 -
+ */ + public okhttp3.Call getHeightCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/block/height"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getHeightValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getHeightCall(_callback); + + } + + /** + * Get the current blockchain height + * + * @return HeightModel + * @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 -
+ */ + public HeightModel getHeight() throws ApiException { + ApiResponse localVarResp = getHeightWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the current blockchain height + * + * @return ApiResponse<HeightModel> + * @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 -
+ */ + public ApiResponse getHeightWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getHeightValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the current blockchain height (asynchronously) + * + * @param _callback The callback to be executed when the API call 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 -
+ */ + public okhttp3.Call getHeightAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getHeightValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for submitBlock + * @param submitBlockRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
406 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call submitBlockCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = submitBlockRequestModel; + + // create path and map variables + String localVarPath = "/block/submit"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitBlockValidateBeforeCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'submitBlockRequestModel' is set + if (submitBlockRequestModel == null) { + throw new ApiException("Missing the required parameter 'submitBlockRequestModel' when calling submitBlock(Async)"); + } + + return submitBlockCall(submitBlockRequestModel, _callback); + + } + + /** + * Submit a new block to the network + * + * @param submitBlockRequestModel (required) + * @return SubmitBlockResponseModel + * @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
406 text/plain -
400 text/plain -
200 OK -
+ */ + public SubmitBlockResponseModel submitBlock(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException { + ApiResponse localVarResp = submitBlockWithHttpInfo(submitBlockRequestModel); + return localVarResp.getData(); + } + + /** + * Submit a new block to the network + * + * @param submitBlockRequestModel (required) + * @return ApiResponse<SubmitBlockResponseModel> + * @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
406 text/plain -
400 text/plain -
200 OK -
+ */ + public ApiResponse submitBlockWithHttpInfo(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException { + okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Submit a new block to the network (asynchronously) + * + * @param submitBlockRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
406 text/plain -
400 text/plain -
200 OK -
+ */ + public okhttp3.Call submitBlockAsync(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/api/InfoApi.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/api/InfoApi.java new file mode 100644 index 00000000..6596aa15 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/api/InfoApi.java @@ -0,0 +1,318 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.InfoModel; +import org.openapitools.client.model.VersionModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InfoApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InfoApi() { + this(Configuration.getDefaultApiClient()); + } + + public InfoApi(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 getInfo + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getInfoCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/info"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (flags != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("flags", flags)); + } + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInfoValidateBeforeCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + return getInfoCall(flags, _callback); + + } + + /** + * Get detailed information about the blockchain and daemon state + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @return InfoModel + * @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 -
+ */ + public InfoModel getInfo(@javax.annotation.Nullable String flags) throws ApiException { + ApiResponse localVarResp = getInfoWithHttpInfo(flags); + return localVarResp.getData(); + } + + /** + * Get detailed information about the blockchain and daemon state + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @return ApiResponse<InfoModel> + * @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 -
+ */ + public ApiResponse getInfoWithHttpInfo(@javax.annotation.Nullable String flags) throws ApiException { + okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get detailed information about the blockchain and daemon state (asynchronously) + * + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getInfoAsync(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for version + * @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 -
+ */ + public okhttp3.Call versionCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/info/version"; + + 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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call versionValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return versionCall(_callback); + + } + + /** + * Get API version + * Returns the current version of the API. + * @return VersionModel + * @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 -
+ */ + public VersionModel version() throws ApiException { + ApiResponse localVarResp = versionWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get API version + * Returns the current version of the API. + * @return ApiResponse<VersionModel> + * @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 -
+ */ + public ApiResponse versionWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = versionValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get API version (asynchronously) + * Returns the current version of the API. + * @param _callback The callback to be executed when the API call 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 -
+ */ + public okhttp3.Call versionAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = versionValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000..fe8f8307 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/Authentication.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000..e26548b4 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,37 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000..9dc4c161 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000..6519f827 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:17:29.381548+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000..87c49961 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import invalidPackageName.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockDetailsModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockDetailsModel.java new file mode 100644 index 00000000..77b15bbd --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockDetailsModel.java @@ -0,0 +1,885 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.TransactionDetailsModel; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * BlockDetailsModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class BlockDetailsModel { + public static final String SERIALIZED_NAME_ACTUAL_TIMESTAMP = "actual_timestamp"; + @SerializedName(SERIALIZED_NAME_ACTUAL_TIMESTAMP) + @javax.annotation.Nullable + private Integer actualTimestamp; + + public static final String SERIALIZED_NAME_ALREADY_GENERATED_COINS = "already_generated_coins"; + @SerializedName(SERIALIZED_NAME_ALREADY_GENERATED_COINS) + @javax.annotation.Nullable + private String alreadyGeneratedCoins; + + public static final String SERIALIZED_NAME_BASE_REWARD = "base_reward"; + @SerializedName(SERIALIZED_NAME_BASE_REWARD) + @javax.annotation.Nullable + private Integer baseReward; + + public static final String SERIALIZED_NAME_BLOB = "blob"; + @SerializedName(SERIALIZED_NAME_BLOB) + @javax.annotation.Nullable + private String blob; + + public static final String SERIALIZED_NAME_BLOCK_CUMULATIVE_SIZE = "block_cumulative_size"; + @SerializedName(SERIALIZED_NAME_BLOCK_CUMULATIVE_SIZE) + @javax.annotation.Nullable + private Integer blockCumulativeSize; + + public static final String SERIALIZED_NAME_BLOCK_TSELF_SIZE = "block_tself_size"; + @SerializedName(SERIALIZED_NAME_BLOCK_TSELF_SIZE) + @javax.annotation.Nullable + private Integer blockTselfSize; + + public static final String SERIALIZED_NAME_CUMULATIVE_DIFF_ADJUSTED = "cumulative_diff_adjusted"; + @SerializedName(SERIALIZED_NAME_CUMULATIVE_DIFF_ADJUSTED) + @javax.annotation.Nullable + private String cumulativeDiffAdjusted; + + public static final String SERIALIZED_NAME_CUMULATIVE_DIFF_PRECISE = "cumulative_diff_precise"; + @SerializedName(SERIALIZED_NAME_CUMULATIVE_DIFF_PRECISE) + @javax.annotation.Nullable + private String cumulativeDiffPrecise; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + @javax.annotation.Nullable + private String difficulty; + + public static final String SERIALIZED_NAME_EFFECTIVE_FEE_MEDIAN = "effective_fee_median"; + @SerializedName(SERIALIZED_NAME_EFFECTIVE_FEE_MEDIAN) + @javax.annotation.Nullable + private Integer effectiveFeeMedian; + + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + @javax.annotation.Nullable + private Integer height; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_IS_ORPHAN = "is_orphan"; + @SerializedName(SERIALIZED_NAME_IS_ORPHAN) + @javax.annotation.Nullable + private Boolean isOrphan; + + public static final String SERIALIZED_NAME_MINER_TEXT_INFO = "miner_text_info"; + @SerializedName(SERIALIZED_NAME_MINER_TEXT_INFO) + @javax.annotation.Nullable + private String minerTextInfo; + + public static final String SERIALIZED_NAME_OBJECT_IN_JSON = "object_in_json"; + @SerializedName(SERIALIZED_NAME_OBJECT_IN_JSON) + @javax.annotation.Nullable + private String objectInJson; + + public static final String SERIALIZED_NAME_PENALTY = "penalty"; + @SerializedName(SERIALIZED_NAME_PENALTY) + @javax.annotation.Nullable + private Integer penalty; + + public static final String SERIALIZED_NAME_POW_SEED = "pow_seed"; + @SerializedName(SERIALIZED_NAME_POW_SEED) + @javax.annotation.Nullable + private String powSeed; + + public static final String SERIALIZED_NAME_PREV_ID = "prev_id"; + @SerializedName(SERIALIZED_NAME_PREV_ID) + @javax.annotation.Nullable + private String prevId; + + public static final String SERIALIZED_NAME_SUMMARY_REWARD = "summary_reward"; + @SerializedName(SERIALIZED_NAME_SUMMARY_REWARD) + @javax.annotation.Nullable + private Integer summaryReward; + + public static final String SERIALIZED_NAME_THIS_BLOCK_FEE_MEDIAN = "this_block_fee_median"; + @SerializedName(SERIALIZED_NAME_THIS_BLOCK_FEE_MEDIAN) + @javax.annotation.Nullable + private Integer thisBlockFeeMedian; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @javax.annotation.Nullable + private Integer timestamp; + + public static final String SERIALIZED_NAME_TOTAL_FEE = "total_fee"; + @SerializedName(SERIALIZED_NAME_TOTAL_FEE) + @javax.annotation.Nullable + private Integer totalFee; + + public static final String SERIALIZED_NAME_TOTAL_TXS_SIZE = "total_txs_size"; + @SerializedName(SERIALIZED_NAME_TOTAL_TXS_SIZE) + @javax.annotation.Nullable + private Integer totalTxsSize; + + public static final String SERIALIZED_NAME_TRANSACTIONS_DETAILS = "transactions_details"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_DETAILS) + @javax.annotation.Nullable + private List transactionsDetails = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private Integer type; + + public BlockDetailsModel() { + } + + public BlockDetailsModel actualTimestamp(@javax.annotation.Nullable Integer actualTimestamp) { + this.actualTimestamp = actualTimestamp; + return this; + } + + /** + * Get actualTimestamp + * @return actualTimestamp + */ + @javax.annotation.Nullable + public Integer getActualTimestamp() { + return actualTimestamp; + } + + public void setActualTimestamp(@javax.annotation.Nullable Integer actualTimestamp) { + this.actualTimestamp = actualTimestamp; + } + + + public BlockDetailsModel alreadyGeneratedCoins(@javax.annotation.Nullable String alreadyGeneratedCoins) { + this.alreadyGeneratedCoins = alreadyGeneratedCoins; + return this; + } + + /** + * Get alreadyGeneratedCoins + * @return alreadyGeneratedCoins + */ + @javax.annotation.Nullable + public String getAlreadyGeneratedCoins() { + return alreadyGeneratedCoins; + } + + public void setAlreadyGeneratedCoins(@javax.annotation.Nullable String alreadyGeneratedCoins) { + this.alreadyGeneratedCoins = alreadyGeneratedCoins; + } + + + public BlockDetailsModel baseReward(@javax.annotation.Nullable Integer baseReward) { + this.baseReward = baseReward; + return this; + } + + /** + * Get baseReward + * @return baseReward + */ + @javax.annotation.Nullable + public Integer getBaseReward() { + return baseReward; + } + + public void setBaseReward(@javax.annotation.Nullable Integer baseReward) { + this.baseReward = baseReward; + } + + + public BlockDetailsModel blob(@javax.annotation.Nullable String blob) { + this.blob = blob; + return this; + } + + /** + * Get blob + * @return blob + */ + @javax.annotation.Nullable + public String getBlob() { + return blob; + } + + public void setBlob(@javax.annotation.Nullable String blob) { + this.blob = blob; + } + + + public BlockDetailsModel blockCumulativeSize(@javax.annotation.Nullable Integer blockCumulativeSize) { + this.blockCumulativeSize = blockCumulativeSize; + return this; + } + + /** + * Get blockCumulativeSize + * @return blockCumulativeSize + */ + @javax.annotation.Nullable + public Integer getBlockCumulativeSize() { + return blockCumulativeSize; + } + + public void setBlockCumulativeSize(@javax.annotation.Nullable Integer blockCumulativeSize) { + this.blockCumulativeSize = blockCumulativeSize; + } + + + public BlockDetailsModel blockTselfSize(@javax.annotation.Nullable Integer blockTselfSize) { + this.blockTselfSize = blockTselfSize; + return this; + } + + /** + * Get blockTselfSize + * @return blockTselfSize + */ + @javax.annotation.Nullable + public Integer getBlockTselfSize() { + return blockTselfSize; + } + + public void setBlockTselfSize(@javax.annotation.Nullable Integer blockTselfSize) { + this.blockTselfSize = blockTselfSize; + } + + + public BlockDetailsModel cumulativeDiffAdjusted(@javax.annotation.Nullable String cumulativeDiffAdjusted) { + this.cumulativeDiffAdjusted = cumulativeDiffAdjusted; + return this; + } + + /** + * Get cumulativeDiffAdjusted + * @return cumulativeDiffAdjusted + */ + @javax.annotation.Nullable + public String getCumulativeDiffAdjusted() { + return cumulativeDiffAdjusted; + } + + public void setCumulativeDiffAdjusted(@javax.annotation.Nullable String cumulativeDiffAdjusted) { + this.cumulativeDiffAdjusted = cumulativeDiffAdjusted; + } + + + public BlockDetailsModel cumulativeDiffPrecise(@javax.annotation.Nullable String cumulativeDiffPrecise) { + this.cumulativeDiffPrecise = cumulativeDiffPrecise; + return this; + } + + /** + * Get cumulativeDiffPrecise + * @return cumulativeDiffPrecise + */ + @javax.annotation.Nullable + public String getCumulativeDiffPrecise() { + return cumulativeDiffPrecise; + } + + public void setCumulativeDiffPrecise(@javax.annotation.Nullable String cumulativeDiffPrecise) { + this.cumulativeDiffPrecise = cumulativeDiffPrecise; + } + + + public BlockDetailsModel difficulty(@javax.annotation.Nullable String difficulty) { + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + */ + @javax.annotation.Nullable + public String getDifficulty() { + return difficulty; + } + + public void setDifficulty(@javax.annotation.Nullable String difficulty) { + this.difficulty = difficulty; + } + + + public BlockDetailsModel effectiveFeeMedian(@javax.annotation.Nullable Integer effectiveFeeMedian) { + this.effectiveFeeMedian = effectiveFeeMedian; + return this; + } + + /** + * Get effectiveFeeMedian + * @return effectiveFeeMedian + */ + @javax.annotation.Nullable + public Integer getEffectiveFeeMedian() { + return effectiveFeeMedian; + } + + public void setEffectiveFeeMedian(@javax.annotation.Nullable Integer effectiveFeeMedian) { + this.effectiveFeeMedian = effectiveFeeMedian; + } + + + public BlockDetailsModel height(@javax.annotation.Nullable Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * @return height + */ + @javax.annotation.Nullable + public Integer getHeight() { + return height; + } + + public void setHeight(@javax.annotation.Nullable Integer height) { + this.height = height; + } + + + public BlockDetailsModel id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public BlockDetailsModel isOrphan(@javax.annotation.Nullable Boolean isOrphan) { + this.isOrphan = isOrphan; + return this; + } + + /** + * Get isOrphan + * @return isOrphan + */ + @javax.annotation.Nullable + public Boolean getIsOrphan() { + return isOrphan; + } + + public void setIsOrphan(@javax.annotation.Nullable Boolean isOrphan) { + this.isOrphan = isOrphan; + } + + + public BlockDetailsModel minerTextInfo(@javax.annotation.Nullable String minerTextInfo) { + this.minerTextInfo = minerTextInfo; + return this; + } + + /** + * Get minerTextInfo + * @return minerTextInfo + */ + @javax.annotation.Nullable + public String getMinerTextInfo() { + return minerTextInfo; + } + + public void setMinerTextInfo(@javax.annotation.Nullable String minerTextInfo) { + this.minerTextInfo = minerTextInfo; + } + + + public BlockDetailsModel objectInJson(@javax.annotation.Nullable String objectInJson) { + this.objectInJson = objectInJson; + return this; + } + + /** + * Get objectInJson + * @return objectInJson + */ + @javax.annotation.Nullable + public String getObjectInJson() { + return objectInJson; + } + + public void setObjectInJson(@javax.annotation.Nullable String objectInJson) { + this.objectInJson = objectInJson; + } + + + public BlockDetailsModel penalty(@javax.annotation.Nullable Integer penalty) { + this.penalty = penalty; + return this; + } + + /** + * Get penalty + * @return penalty + */ + @javax.annotation.Nullable + public Integer getPenalty() { + return penalty; + } + + public void setPenalty(@javax.annotation.Nullable Integer penalty) { + this.penalty = penalty; + } + + + public BlockDetailsModel powSeed(@javax.annotation.Nullable String powSeed) { + this.powSeed = powSeed; + return this; + } + + /** + * Get powSeed + * @return powSeed + */ + @javax.annotation.Nullable + public String getPowSeed() { + return powSeed; + } + + public void setPowSeed(@javax.annotation.Nullable String powSeed) { + this.powSeed = powSeed; + } + + + public BlockDetailsModel prevId(@javax.annotation.Nullable String prevId) { + this.prevId = prevId; + return this; + } + + /** + * Get prevId + * @return prevId + */ + @javax.annotation.Nullable + public String getPrevId() { + return prevId; + } + + public void setPrevId(@javax.annotation.Nullable String prevId) { + this.prevId = prevId; + } + + + public BlockDetailsModel summaryReward(@javax.annotation.Nullable Integer summaryReward) { + this.summaryReward = summaryReward; + return this; + } + + /** + * Get summaryReward + * @return summaryReward + */ + @javax.annotation.Nullable + public Integer getSummaryReward() { + return summaryReward; + } + + public void setSummaryReward(@javax.annotation.Nullable Integer summaryReward) { + this.summaryReward = summaryReward; + } + + + public BlockDetailsModel thisBlockFeeMedian(@javax.annotation.Nullable Integer thisBlockFeeMedian) { + this.thisBlockFeeMedian = thisBlockFeeMedian; + return this; + } + + /** + * Get thisBlockFeeMedian + * @return thisBlockFeeMedian + */ + @javax.annotation.Nullable + public Integer getThisBlockFeeMedian() { + return thisBlockFeeMedian; + } + + public void setThisBlockFeeMedian(@javax.annotation.Nullable Integer thisBlockFeeMedian) { + this.thisBlockFeeMedian = thisBlockFeeMedian; + } + + + public BlockDetailsModel timestamp(@javax.annotation.Nullable Integer timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + */ + @javax.annotation.Nullable + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(@javax.annotation.Nullable Integer timestamp) { + this.timestamp = timestamp; + } + + + public BlockDetailsModel totalFee(@javax.annotation.Nullable Integer totalFee) { + this.totalFee = totalFee; + return this; + } + + /** + * Get totalFee + * @return totalFee + */ + @javax.annotation.Nullable + public Integer getTotalFee() { + return totalFee; + } + + public void setTotalFee(@javax.annotation.Nullable Integer totalFee) { + this.totalFee = totalFee; + } + + + public BlockDetailsModel totalTxsSize(@javax.annotation.Nullable Integer totalTxsSize) { + this.totalTxsSize = totalTxsSize; + return this; + } + + /** + * Get totalTxsSize + * @return totalTxsSize + */ + @javax.annotation.Nullable + public Integer getTotalTxsSize() { + return totalTxsSize; + } + + public void setTotalTxsSize(@javax.annotation.Nullable Integer totalTxsSize) { + this.totalTxsSize = totalTxsSize; + } + + + public BlockDetailsModel transactionsDetails(@javax.annotation.Nullable List transactionsDetails) { + this.transactionsDetails = transactionsDetails; + return this; + } + + public BlockDetailsModel addTransactionsDetailsItem(TransactionDetailsModel transactionsDetailsItem) { + if (this.transactionsDetails == null) { + this.transactionsDetails = new ArrayList<>(); + } + this.transactionsDetails.add(transactionsDetailsItem); + return this; + } + + /** + * Get transactionsDetails + * @return transactionsDetails + */ + @javax.annotation.Nullable + public List getTransactionsDetails() { + return transactionsDetails; + } + + public void setTransactionsDetails(@javax.annotation.Nullable List transactionsDetails) { + this.transactionsDetails = transactionsDetails; + } + + + public BlockDetailsModel type(@javax.annotation.Nullable Integer type) { + this.type = type; + return this; + } + + /** + * Get type + * minimum: 0 + * maximum: 4294967295 + * @return type + */ + @javax.annotation.Nullable + public Integer getType() { + return type; + } + + public void setType(@javax.annotation.Nullable Integer type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BlockDetailsModel blockDetailsModel = (BlockDetailsModel) o; + return Objects.equals(this.actualTimestamp, blockDetailsModel.actualTimestamp) && + Objects.equals(this.alreadyGeneratedCoins, blockDetailsModel.alreadyGeneratedCoins) && + Objects.equals(this.baseReward, blockDetailsModel.baseReward) && + Objects.equals(this.blob, blockDetailsModel.blob) && + Objects.equals(this.blockCumulativeSize, blockDetailsModel.blockCumulativeSize) && + Objects.equals(this.blockTselfSize, blockDetailsModel.blockTselfSize) && + Objects.equals(this.cumulativeDiffAdjusted, blockDetailsModel.cumulativeDiffAdjusted) && + Objects.equals(this.cumulativeDiffPrecise, blockDetailsModel.cumulativeDiffPrecise) && + Objects.equals(this.difficulty, blockDetailsModel.difficulty) && + Objects.equals(this.effectiveFeeMedian, blockDetailsModel.effectiveFeeMedian) && + Objects.equals(this.height, blockDetailsModel.height) && + Objects.equals(this.id, blockDetailsModel.id) && + Objects.equals(this.isOrphan, blockDetailsModel.isOrphan) && + Objects.equals(this.minerTextInfo, blockDetailsModel.minerTextInfo) && + Objects.equals(this.objectInJson, blockDetailsModel.objectInJson) && + Objects.equals(this.penalty, blockDetailsModel.penalty) && + Objects.equals(this.powSeed, blockDetailsModel.powSeed) && + Objects.equals(this.prevId, blockDetailsModel.prevId) && + Objects.equals(this.summaryReward, blockDetailsModel.summaryReward) && + Objects.equals(this.thisBlockFeeMedian, blockDetailsModel.thisBlockFeeMedian) && + Objects.equals(this.timestamp, blockDetailsModel.timestamp) && + Objects.equals(this.totalFee, blockDetailsModel.totalFee) && + Objects.equals(this.totalTxsSize, blockDetailsModel.totalTxsSize) && + Objects.equals(this.transactionsDetails, blockDetailsModel.transactionsDetails) && + Objects.equals(this.type, blockDetailsModel.type); + } + + @Override + public int hashCode() { + return Objects.hash(actualTimestamp, alreadyGeneratedCoins, baseReward, blob, blockCumulativeSize, blockTselfSize, cumulativeDiffAdjusted, cumulativeDiffPrecise, difficulty, effectiveFeeMedian, height, id, isOrphan, minerTextInfo, objectInJson, penalty, powSeed, prevId, summaryReward, thisBlockFeeMedian, timestamp, totalFee, totalTxsSize, transactionsDetails, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BlockDetailsModel {\n"); + sb.append(" actualTimestamp: ").append(toIndentedString(actualTimestamp)).append("\n"); + sb.append(" alreadyGeneratedCoins: ").append(toIndentedString(alreadyGeneratedCoins)).append("\n"); + sb.append(" baseReward: ").append(toIndentedString(baseReward)).append("\n"); + sb.append(" blob: ").append(toIndentedString(blob)).append("\n"); + sb.append(" blockCumulativeSize: ").append(toIndentedString(blockCumulativeSize)).append("\n"); + sb.append(" blockTselfSize: ").append(toIndentedString(blockTselfSize)).append("\n"); + sb.append(" cumulativeDiffAdjusted: ").append(toIndentedString(cumulativeDiffAdjusted)).append("\n"); + sb.append(" cumulativeDiffPrecise: ").append(toIndentedString(cumulativeDiffPrecise)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" effectiveFeeMedian: ").append(toIndentedString(effectiveFeeMedian)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isOrphan: ").append(toIndentedString(isOrphan)).append("\n"); + sb.append(" minerTextInfo: ").append(toIndentedString(minerTextInfo)).append("\n"); + sb.append(" objectInJson: ").append(toIndentedString(objectInJson)).append("\n"); + sb.append(" penalty: ").append(toIndentedString(penalty)).append("\n"); + sb.append(" powSeed: ").append(toIndentedString(powSeed)).append("\n"); + sb.append(" prevId: ").append(toIndentedString(prevId)).append("\n"); + sb.append(" summaryReward: ").append(toIndentedString(summaryReward)).append("\n"); + sb.append(" thisBlockFeeMedian: ").append(toIndentedString(thisBlockFeeMedian)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" totalFee: ").append(toIndentedString(totalFee)).append("\n"); + sb.append(" totalTxsSize: ").append(toIndentedString(totalTxsSize)).append("\n"); + sb.append(" transactionsDetails: ").append(toIndentedString(transactionsDetails)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("actual_timestamp", "already_generated_coins", "base_reward", "blob", "block_cumulative_size", "block_tself_size", "cumulative_diff_adjusted", "cumulative_diff_precise", "difficulty", "effective_fee_median", "height", "id", "is_orphan", "miner_text_info", "object_in_json", "penalty", "pow_seed", "prev_id", "summary_reward", "this_block_fee_median", "timestamp", "total_fee", "total_txs_size", "transactions_details", "type")); + + // 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 BlockDetailsModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BlockDetailsModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BlockDetailsModel is not found in the empty JSON string", BlockDetailsModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BlockDetailsModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BlockDetailsModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("already_generated_coins") != null && !jsonObj.get("already_generated_coins").isJsonNull()) && !jsonObj.get("already_generated_coins").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `already_generated_coins` to be a primitive type in the JSON string but got `%s`", jsonObj.get("already_generated_coins").toString())); + } + if ((jsonObj.get("blob") != null && !jsonObj.get("blob").isJsonNull()) && !jsonObj.get("blob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `blob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blob").toString())); + } + if ((jsonObj.get("cumulative_diff_adjusted") != null && !jsonObj.get("cumulative_diff_adjusted").isJsonNull()) && !jsonObj.get("cumulative_diff_adjusted").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `cumulative_diff_adjusted` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cumulative_diff_adjusted").toString())); + } + if ((jsonObj.get("cumulative_diff_precise") != null && !jsonObj.get("cumulative_diff_precise").isJsonNull()) && !jsonObj.get("cumulative_diff_precise").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `cumulative_diff_precise` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cumulative_diff_precise").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("miner_text_info") != null && !jsonObj.get("miner_text_info").isJsonNull()) && !jsonObj.get("miner_text_info").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `miner_text_info` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner_text_info").toString())); + } + if ((jsonObj.get("object_in_json") != null && !jsonObj.get("object_in_json").isJsonNull()) && !jsonObj.get("object_in_json").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `object_in_json` to be a primitive type in the JSON string but got `%s`", jsonObj.get("object_in_json").toString())); + } + if ((jsonObj.get("pow_seed") != null && !jsonObj.get("pow_seed").isJsonNull()) && !jsonObj.get("pow_seed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pow_seed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pow_seed").toString())); + } + if ((jsonObj.get("prev_id") != null && !jsonObj.get("prev_id").isJsonNull()) && !jsonObj.get("prev_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `prev_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prev_id").toString())); + } + if (jsonObj.get("transactions_details") != null && !jsonObj.get("transactions_details").isJsonNull()) { + JsonArray jsonArraytransactionsDetails = jsonObj.getAsJsonArray("transactions_details"); + if (jsonArraytransactionsDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("transactions_details").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `transactions_details` to be an array in the JSON string but got `%s`", jsonObj.get("transactions_details").toString())); + } + + // validate the optional field `transactions_details` (array) + for (int i = 0; i < jsonArraytransactionsDetails.size(); i++) { + TransactionDetailsModel.validateJsonElement(jsonArraytransactionsDetails.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BlockDetailsModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BlockDetailsModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BlockDetailsModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BlockDetailsModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BlockDetailsModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BlockDetailsModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of BlockDetailsModel + * @throws IOException if the JSON string is invalid with respect to BlockDetailsModel + */ + public static BlockDetailsModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BlockDetailsModel.class); + } + + /** + * Convert an instance of BlockDetailsModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockProcessingPerformanceModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockProcessingPerformanceModel.java new file mode 100644 index 00000000..df42cb3a --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockProcessingPerformanceModel.java @@ -0,0 +1,594 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * BlockProcessingPerformanceModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class BlockProcessingPerformanceModel { + public static final String SERIALIZED_NAME_BLOCK_PROCESSING_TIME0 = "block_processing_time_0"; + @SerializedName(SERIALIZED_NAME_BLOCK_PROCESSING_TIME0) + @javax.annotation.Nullable + private Integer blockProcessingTime0; + + public static final String SERIALIZED_NAME_BLOCK_PROCESSING_TIME1 = "block_processing_time_1"; + @SerializedName(SERIALIZED_NAME_BLOCK_PROCESSING_TIME1) + @javax.annotation.Nullable + private Integer blockProcessingTime1; + + public static final String SERIALIZED_NAME_TARGET_CALCULATING_TIME2 = "target_calculating_time_2"; + @SerializedName(SERIALIZED_NAME_TARGET_CALCULATING_TIME2) + @javax.annotation.Nullable + private Integer targetCalculatingTime2; + + public static final String SERIALIZED_NAME_LONGHASH_CALCULATING_TIME3 = "longhash_calculating_time_3"; + @SerializedName(SERIALIZED_NAME_LONGHASH_CALCULATING_TIME3) + @javax.annotation.Nullable + private Integer longhashCalculatingTime3; + + public static final String SERIALIZED_NAME_ALL_TXS_INSERT_TIME5 = "all_txs_insert_time_5"; + @SerializedName(SERIALIZED_NAME_ALL_TXS_INSERT_TIME5) + @javax.annotation.Nullable + private Integer allTxsInsertTime5; + + public static final String SERIALIZED_NAME_ETC_STUFF6 = "etc_stuff_6"; + @SerializedName(SERIALIZED_NAME_ETC_STUFF6) + @javax.annotation.Nullable + private Integer etcStuff6; + + public static final String SERIALIZED_NAME_INSERT_TIME4 = "insert_time_4"; + @SerializedName(SERIALIZED_NAME_INSERT_TIME4) + @javax.annotation.Nullable + private Integer insertTime4; + + public static final String SERIALIZED_NAME_RAISE_BLOCK_CORE_EVENT = "raise_block_core_event"; + @SerializedName(SERIALIZED_NAME_RAISE_BLOCK_CORE_EVENT) + @javax.annotation.Nullable + private Integer raiseBlockCoreEvent; + + public static final String SERIALIZED_NAME_VALIDATE_MINER_TRANSACTION_TIME = "validate_miner_transaction_time"; + @SerializedName(SERIALIZED_NAME_VALIDATE_MINER_TRANSACTION_TIME) + @javax.annotation.Nullable + private Integer validateMinerTransactionTime; + + public static final String SERIALIZED_NAME_COLLECT_RANGEPROOFS_DATA_FROM_TX_TIME = "collect_rangeproofs_data_from_tx_time"; + @SerializedName(SERIALIZED_NAME_COLLECT_RANGEPROOFS_DATA_FROM_TX_TIME) + @javax.annotation.Nullable + private Integer collectRangeproofsDataFromTxTime; + + public static final String SERIALIZED_NAME_VERIFY_MULTIPLE_ZC_OUTS_RANGE_PROOFS_TIME = "verify_multiple_zc_outs_range_proofs_time"; + @SerializedName(SERIALIZED_NAME_VERIFY_MULTIPLE_ZC_OUTS_RANGE_PROOFS_TIME) + @javax.annotation.Nullable + private Integer verifyMultipleZcOutsRangeProofsTime; + + public static final String SERIALIZED_NAME_TARGET_CALCULATING_ENUM_BLOCKS = "target_calculating_enum_blocks"; + @SerializedName(SERIALIZED_NAME_TARGET_CALCULATING_ENUM_BLOCKS) + @javax.annotation.Nullable + private Integer targetCalculatingEnumBlocks; + + public static final String SERIALIZED_NAME_TARGET_CALCULATING_CALC = "target_calculating_calc"; + @SerializedName(SERIALIZED_NAME_TARGET_CALCULATING_CALC) + @javax.annotation.Nullable + private Integer targetCalculatingCalc; + + public static final String SERIALIZED_NAME_POS_VALIDATE_KI_SEARCH = "pos_validate_ki_search"; + @SerializedName(SERIALIZED_NAME_POS_VALIDATE_KI_SEARCH) + @javax.annotation.Nullable + private Integer posValidateKiSearch; + + public static final String SERIALIZED_NAME_POS_VALIDATE_GET_OUT_KEYS_FOR_INPUTS = "pos_validate_get_out_keys_for_inputs"; + @SerializedName(SERIALIZED_NAME_POS_VALIDATE_GET_OUT_KEYS_FOR_INPUTS) + @javax.annotation.Nullable + private Integer posValidateGetOutKeysForInputs; + + public static final String SERIALIZED_NAME_POS_VALIDATE_ZVP = "pos_validate_zvp"; + @SerializedName(SERIALIZED_NAME_POS_VALIDATE_ZVP) + @javax.annotation.Nullable + private Integer posValidateZvp; + + public BlockProcessingPerformanceModel() { + } + + public BlockProcessingPerformanceModel blockProcessingTime0(@javax.annotation.Nullable Integer blockProcessingTime0) { + this.blockProcessingTime0 = blockProcessingTime0; + return this; + } + + /** + * Get blockProcessingTime0 + * @return blockProcessingTime0 + */ + @javax.annotation.Nullable + public Integer getBlockProcessingTime0() { + return blockProcessingTime0; + } + + public void setBlockProcessingTime0(@javax.annotation.Nullable Integer blockProcessingTime0) { + this.blockProcessingTime0 = blockProcessingTime0; + } + + + public BlockProcessingPerformanceModel blockProcessingTime1(@javax.annotation.Nullable Integer blockProcessingTime1) { + this.blockProcessingTime1 = blockProcessingTime1; + return this; + } + + /** + * Get blockProcessingTime1 + * @return blockProcessingTime1 + */ + @javax.annotation.Nullable + public Integer getBlockProcessingTime1() { + return blockProcessingTime1; + } + + public void setBlockProcessingTime1(@javax.annotation.Nullable Integer blockProcessingTime1) { + this.blockProcessingTime1 = blockProcessingTime1; + } + + + public BlockProcessingPerformanceModel targetCalculatingTime2(@javax.annotation.Nullable Integer targetCalculatingTime2) { + this.targetCalculatingTime2 = targetCalculatingTime2; + return this; + } + + /** + * Get targetCalculatingTime2 + * @return targetCalculatingTime2 + */ + @javax.annotation.Nullable + public Integer getTargetCalculatingTime2() { + return targetCalculatingTime2; + } + + public void setTargetCalculatingTime2(@javax.annotation.Nullable Integer targetCalculatingTime2) { + this.targetCalculatingTime2 = targetCalculatingTime2; + } + + + public BlockProcessingPerformanceModel longhashCalculatingTime3(@javax.annotation.Nullable Integer longhashCalculatingTime3) { + this.longhashCalculatingTime3 = longhashCalculatingTime3; + return this; + } + + /** + * Get longhashCalculatingTime3 + * @return longhashCalculatingTime3 + */ + @javax.annotation.Nullable + public Integer getLonghashCalculatingTime3() { + return longhashCalculatingTime3; + } + + public void setLonghashCalculatingTime3(@javax.annotation.Nullable Integer longhashCalculatingTime3) { + this.longhashCalculatingTime3 = longhashCalculatingTime3; + } + + + public BlockProcessingPerformanceModel allTxsInsertTime5(@javax.annotation.Nullable Integer allTxsInsertTime5) { + this.allTxsInsertTime5 = allTxsInsertTime5; + return this; + } + + /** + * Get allTxsInsertTime5 + * @return allTxsInsertTime5 + */ + @javax.annotation.Nullable + public Integer getAllTxsInsertTime5() { + return allTxsInsertTime5; + } + + public void setAllTxsInsertTime5(@javax.annotation.Nullable Integer allTxsInsertTime5) { + this.allTxsInsertTime5 = allTxsInsertTime5; + } + + + public BlockProcessingPerformanceModel etcStuff6(@javax.annotation.Nullable Integer etcStuff6) { + this.etcStuff6 = etcStuff6; + return this; + } + + /** + * Get etcStuff6 + * @return etcStuff6 + */ + @javax.annotation.Nullable + public Integer getEtcStuff6() { + return etcStuff6; + } + + public void setEtcStuff6(@javax.annotation.Nullable Integer etcStuff6) { + this.etcStuff6 = etcStuff6; + } + + + public BlockProcessingPerformanceModel insertTime4(@javax.annotation.Nullable Integer insertTime4) { + this.insertTime4 = insertTime4; + return this; + } + + /** + * Get insertTime4 + * @return insertTime4 + */ + @javax.annotation.Nullable + public Integer getInsertTime4() { + return insertTime4; + } + + public void setInsertTime4(@javax.annotation.Nullable Integer insertTime4) { + this.insertTime4 = insertTime4; + } + + + public BlockProcessingPerformanceModel raiseBlockCoreEvent(@javax.annotation.Nullable Integer raiseBlockCoreEvent) { + this.raiseBlockCoreEvent = raiseBlockCoreEvent; + return this; + } + + /** + * Get raiseBlockCoreEvent + * @return raiseBlockCoreEvent + */ + @javax.annotation.Nullable + public Integer getRaiseBlockCoreEvent() { + return raiseBlockCoreEvent; + } + + public void setRaiseBlockCoreEvent(@javax.annotation.Nullable Integer raiseBlockCoreEvent) { + this.raiseBlockCoreEvent = raiseBlockCoreEvent; + } + + + public BlockProcessingPerformanceModel validateMinerTransactionTime(@javax.annotation.Nullable Integer validateMinerTransactionTime) { + this.validateMinerTransactionTime = validateMinerTransactionTime; + return this; + } + + /** + * Get validateMinerTransactionTime + * @return validateMinerTransactionTime + */ + @javax.annotation.Nullable + public Integer getValidateMinerTransactionTime() { + return validateMinerTransactionTime; + } + + public void setValidateMinerTransactionTime(@javax.annotation.Nullable Integer validateMinerTransactionTime) { + this.validateMinerTransactionTime = validateMinerTransactionTime; + } + + + public BlockProcessingPerformanceModel collectRangeproofsDataFromTxTime(@javax.annotation.Nullable Integer collectRangeproofsDataFromTxTime) { + this.collectRangeproofsDataFromTxTime = collectRangeproofsDataFromTxTime; + return this; + } + + /** + * Get collectRangeproofsDataFromTxTime + * @return collectRangeproofsDataFromTxTime + */ + @javax.annotation.Nullable + public Integer getCollectRangeproofsDataFromTxTime() { + return collectRangeproofsDataFromTxTime; + } + + public void setCollectRangeproofsDataFromTxTime(@javax.annotation.Nullable Integer collectRangeproofsDataFromTxTime) { + this.collectRangeproofsDataFromTxTime = collectRangeproofsDataFromTxTime; + } + + + public BlockProcessingPerformanceModel verifyMultipleZcOutsRangeProofsTime(@javax.annotation.Nullable Integer verifyMultipleZcOutsRangeProofsTime) { + this.verifyMultipleZcOutsRangeProofsTime = verifyMultipleZcOutsRangeProofsTime; + return this; + } + + /** + * Get verifyMultipleZcOutsRangeProofsTime + * @return verifyMultipleZcOutsRangeProofsTime + */ + @javax.annotation.Nullable + public Integer getVerifyMultipleZcOutsRangeProofsTime() { + return verifyMultipleZcOutsRangeProofsTime; + } + + public void setVerifyMultipleZcOutsRangeProofsTime(@javax.annotation.Nullable Integer verifyMultipleZcOutsRangeProofsTime) { + this.verifyMultipleZcOutsRangeProofsTime = verifyMultipleZcOutsRangeProofsTime; + } + + + public BlockProcessingPerformanceModel targetCalculatingEnumBlocks(@javax.annotation.Nullable Integer targetCalculatingEnumBlocks) { + this.targetCalculatingEnumBlocks = targetCalculatingEnumBlocks; + return this; + } + + /** + * Get targetCalculatingEnumBlocks + * @return targetCalculatingEnumBlocks + */ + @javax.annotation.Nullable + public Integer getTargetCalculatingEnumBlocks() { + return targetCalculatingEnumBlocks; + } + + public void setTargetCalculatingEnumBlocks(@javax.annotation.Nullable Integer targetCalculatingEnumBlocks) { + this.targetCalculatingEnumBlocks = targetCalculatingEnumBlocks; + } + + + public BlockProcessingPerformanceModel targetCalculatingCalc(@javax.annotation.Nullable Integer targetCalculatingCalc) { + this.targetCalculatingCalc = targetCalculatingCalc; + return this; + } + + /** + * Get targetCalculatingCalc + * @return targetCalculatingCalc + */ + @javax.annotation.Nullable + public Integer getTargetCalculatingCalc() { + return targetCalculatingCalc; + } + + public void setTargetCalculatingCalc(@javax.annotation.Nullable Integer targetCalculatingCalc) { + this.targetCalculatingCalc = targetCalculatingCalc; + } + + + public BlockProcessingPerformanceModel posValidateKiSearch(@javax.annotation.Nullable Integer posValidateKiSearch) { + this.posValidateKiSearch = posValidateKiSearch; + return this; + } + + /** + * Get posValidateKiSearch + * @return posValidateKiSearch + */ + @javax.annotation.Nullable + public Integer getPosValidateKiSearch() { + return posValidateKiSearch; + } + + public void setPosValidateKiSearch(@javax.annotation.Nullable Integer posValidateKiSearch) { + this.posValidateKiSearch = posValidateKiSearch; + } + + + public BlockProcessingPerformanceModel posValidateGetOutKeysForInputs(@javax.annotation.Nullable Integer posValidateGetOutKeysForInputs) { + this.posValidateGetOutKeysForInputs = posValidateGetOutKeysForInputs; + return this; + } + + /** + * Get posValidateGetOutKeysForInputs + * @return posValidateGetOutKeysForInputs + */ + @javax.annotation.Nullable + public Integer getPosValidateGetOutKeysForInputs() { + return posValidateGetOutKeysForInputs; + } + + public void setPosValidateGetOutKeysForInputs(@javax.annotation.Nullable Integer posValidateGetOutKeysForInputs) { + this.posValidateGetOutKeysForInputs = posValidateGetOutKeysForInputs; + } + + + public BlockProcessingPerformanceModel posValidateZvp(@javax.annotation.Nullable Integer posValidateZvp) { + this.posValidateZvp = posValidateZvp; + return this; + } + + /** + * Get posValidateZvp + * @return posValidateZvp + */ + @javax.annotation.Nullable + public Integer getPosValidateZvp() { + return posValidateZvp; + } + + public void setPosValidateZvp(@javax.annotation.Nullable Integer posValidateZvp) { + this.posValidateZvp = posValidateZvp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BlockProcessingPerformanceModel blockProcessingPerformanceModel = (BlockProcessingPerformanceModel) o; + return Objects.equals(this.blockProcessingTime0, blockProcessingPerformanceModel.blockProcessingTime0) && + Objects.equals(this.blockProcessingTime1, blockProcessingPerformanceModel.blockProcessingTime1) && + Objects.equals(this.targetCalculatingTime2, blockProcessingPerformanceModel.targetCalculatingTime2) && + Objects.equals(this.longhashCalculatingTime3, blockProcessingPerformanceModel.longhashCalculatingTime3) && + Objects.equals(this.allTxsInsertTime5, blockProcessingPerformanceModel.allTxsInsertTime5) && + Objects.equals(this.etcStuff6, blockProcessingPerformanceModel.etcStuff6) && + Objects.equals(this.insertTime4, blockProcessingPerformanceModel.insertTime4) && + Objects.equals(this.raiseBlockCoreEvent, blockProcessingPerformanceModel.raiseBlockCoreEvent) && + Objects.equals(this.validateMinerTransactionTime, blockProcessingPerformanceModel.validateMinerTransactionTime) && + Objects.equals(this.collectRangeproofsDataFromTxTime, blockProcessingPerformanceModel.collectRangeproofsDataFromTxTime) && + Objects.equals(this.verifyMultipleZcOutsRangeProofsTime, blockProcessingPerformanceModel.verifyMultipleZcOutsRangeProofsTime) && + Objects.equals(this.targetCalculatingEnumBlocks, blockProcessingPerformanceModel.targetCalculatingEnumBlocks) && + Objects.equals(this.targetCalculatingCalc, blockProcessingPerformanceModel.targetCalculatingCalc) && + Objects.equals(this.posValidateKiSearch, blockProcessingPerformanceModel.posValidateKiSearch) && + Objects.equals(this.posValidateGetOutKeysForInputs, blockProcessingPerformanceModel.posValidateGetOutKeysForInputs) && + Objects.equals(this.posValidateZvp, blockProcessingPerformanceModel.posValidateZvp); + } + + @Override + public int hashCode() { + return Objects.hash(blockProcessingTime0, blockProcessingTime1, targetCalculatingTime2, longhashCalculatingTime3, allTxsInsertTime5, etcStuff6, insertTime4, raiseBlockCoreEvent, validateMinerTransactionTime, collectRangeproofsDataFromTxTime, verifyMultipleZcOutsRangeProofsTime, targetCalculatingEnumBlocks, targetCalculatingCalc, posValidateKiSearch, posValidateGetOutKeysForInputs, posValidateZvp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BlockProcessingPerformanceModel {\n"); + sb.append(" blockProcessingTime0: ").append(toIndentedString(blockProcessingTime0)).append("\n"); + sb.append(" blockProcessingTime1: ").append(toIndentedString(blockProcessingTime1)).append("\n"); + sb.append(" targetCalculatingTime2: ").append(toIndentedString(targetCalculatingTime2)).append("\n"); + sb.append(" longhashCalculatingTime3: ").append(toIndentedString(longhashCalculatingTime3)).append("\n"); + sb.append(" allTxsInsertTime5: ").append(toIndentedString(allTxsInsertTime5)).append("\n"); + sb.append(" etcStuff6: ").append(toIndentedString(etcStuff6)).append("\n"); + sb.append(" insertTime4: ").append(toIndentedString(insertTime4)).append("\n"); + sb.append(" raiseBlockCoreEvent: ").append(toIndentedString(raiseBlockCoreEvent)).append("\n"); + sb.append(" validateMinerTransactionTime: ").append(toIndentedString(validateMinerTransactionTime)).append("\n"); + sb.append(" collectRangeproofsDataFromTxTime: ").append(toIndentedString(collectRangeproofsDataFromTxTime)).append("\n"); + sb.append(" verifyMultipleZcOutsRangeProofsTime: ").append(toIndentedString(verifyMultipleZcOutsRangeProofsTime)).append("\n"); + sb.append(" targetCalculatingEnumBlocks: ").append(toIndentedString(targetCalculatingEnumBlocks)).append("\n"); + sb.append(" targetCalculatingCalc: ").append(toIndentedString(targetCalculatingCalc)).append("\n"); + sb.append(" posValidateKiSearch: ").append(toIndentedString(posValidateKiSearch)).append("\n"); + sb.append(" posValidateGetOutKeysForInputs: ").append(toIndentedString(posValidateGetOutKeysForInputs)).append("\n"); + sb.append(" posValidateZvp: ").append(toIndentedString(posValidateZvp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("block_processing_time_0", "block_processing_time_1", "target_calculating_time_2", "longhash_calculating_time_3", "all_txs_insert_time_5", "etc_stuff_6", "insert_time_4", "raise_block_core_event", "validate_miner_transaction_time", "collect_rangeproofs_data_from_tx_time", "verify_multiple_zc_outs_range_proofs_time", "target_calculating_enum_blocks", "target_calculating_calc", "pos_validate_ki_search", "pos_validate_get_out_keys_for_inputs", "pos_validate_zvp")); + + // 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 BlockProcessingPerformanceModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BlockProcessingPerformanceModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BlockProcessingPerformanceModel is not found in the empty JSON string", BlockProcessingPerformanceModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BlockProcessingPerformanceModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BlockProcessingPerformanceModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BlockProcessingPerformanceModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BlockProcessingPerformanceModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BlockProcessingPerformanceModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BlockProcessingPerformanceModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BlockProcessingPerformanceModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BlockProcessingPerformanceModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of BlockProcessingPerformanceModel + * @throws IOException if the JSON string is invalid with respect to BlockProcessingPerformanceModel + */ + public static BlockProcessingPerformanceModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BlockProcessingPerformanceModel.class); + } + + /** + * Convert an instance of BlockProcessingPerformanceModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateModel.java new file mode 100644 index 00000000..eecdc0fe --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateModel.java @@ -0,0 +1,429 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.client.model.TxGenerationContextModel; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * BlockTemplateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class BlockTemplateModel { + public static final String SERIALIZED_NAME_BLOCKTEMPLATE_BLOB = "blocktemplate_blob"; + @SerializedName(SERIALIZED_NAME_BLOCKTEMPLATE_BLOB) + @javax.annotation.Nullable + private String blocktemplateBlob; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + @javax.annotation.Nullable + private String difficulty; + + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + @javax.annotation.Nullable + private Integer height; + + public static final String SERIALIZED_NAME_MINER_TX_TGC = "miner_tx_tgc"; + @SerializedName(SERIALIZED_NAME_MINER_TX_TGC) + @javax.annotation.Nullable + private TxGenerationContextModel minerTxTgc; + + public static final String SERIALIZED_NAME_BLOCK_REWARD_WITHOUT_FEE = "block_reward_without_fee"; + @SerializedName(SERIALIZED_NAME_BLOCK_REWARD_WITHOUT_FEE) + @javax.annotation.Nullable + private Integer blockRewardWithoutFee; + + public static final String SERIALIZED_NAME_BLOCK_REWARD = "block_reward"; + @SerializedName(SERIALIZED_NAME_BLOCK_REWARD) + @javax.annotation.Nullable + private Integer blockReward; + + public static final String SERIALIZED_NAME_TXS_FEE = "txs_fee"; + @SerializedName(SERIALIZED_NAME_TXS_FEE) + @javax.annotation.Nullable + private Integer txsFee; + + public static final String SERIALIZED_NAME_PREV_HASH = "prev_hash"; + @SerializedName(SERIALIZED_NAME_PREV_HASH) + @javax.annotation.Nullable + private String prevHash; + + public static final String SERIALIZED_NAME_SEED = "seed"; + @SerializedName(SERIALIZED_NAME_SEED) + @javax.annotation.Nullable + private String seed; + + public BlockTemplateModel() { + } + + public BlockTemplateModel blocktemplateBlob(@javax.annotation.Nullable String blocktemplateBlob) { + this.blocktemplateBlob = blocktemplateBlob; + return this; + } + + /** + * Get blocktemplateBlob + * @return blocktemplateBlob + */ + @javax.annotation.Nullable + public String getBlocktemplateBlob() { + return blocktemplateBlob; + } + + public void setBlocktemplateBlob(@javax.annotation.Nullable String blocktemplateBlob) { + this.blocktemplateBlob = blocktemplateBlob; + } + + + public BlockTemplateModel difficulty(@javax.annotation.Nullable String difficulty) { + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + */ + @javax.annotation.Nullable + public String getDifficulty() { + return difficulty; + } + + public void setDifficulty(@javax.annotation.Nullable String difficulty) { + this.difficulty = difficulty; + } + + + public BlockTemplateModel height(@javax.annotation.Nullable Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * @return height + */ + @javax.annotation.Nullable + public Integer getHeight() { + return height; + } + + public void setHeight(@javax.annotation.Nullable Integer height) { + this.height = height; + } + + + public BlockTemplateModel minerTxTgc(@javax.annotation.Nullable TxGenerationContextModel minerTxTgc) { + this.minerTxTgc = minerTxTgc; + return this; + } + + /** + * Get minerTxTgc + * @return minerTxTgc + */ + @javax.annotation.Nullable + public TxGenerationContextModel getMinerTxTgc() { + return minerTxTgc; + } + + public void setMinerTxTgc(@javax.annotation.Nullable TxGenerationContextModel minerTxTgc) { + this.minerTxTgc = minerTxTgc; + } + + + public BlockTemplateModel blockRewardWithoutFee(@javax.annotation.Nullable Integer blockRewardWithoutFee) { + this.blockRewardWithoutFee = blockRewardWithoutFee; + return this; + } + + /** + * Get blockRewardWithoutFee + * @return blockRewardWithoutFee + */ + @javax.annotation.Nullable + public Integer getBlockRewardWithoutFee() { + return blockRewardWithoutFee; + } + + public void setBlockRewardWithoutFee(@javax.annotation.Nullable Integer blockRewardWithoutFee) { + this.blockRewardWithoutFee = blockRewardWithoutFee; + } + + + public BlockTemplateModel blockReward(@javax.annotation.Nullable Integer blockReward) { + this.blockReward = blockReward; + return this; + } + + /** + * Get blockReward + * @return blockReward + */ + @javax.annotation.Nullable + public Integer getBlockReward() { + return blockReward; + } + + public void setBlockReward(@javax.annotation.Nullable Integer blockReward) { + this.blockReward = blockReward; + } + + + public BlockTemplateModel txsFee(@javax.annotation.Nullable Integer txsFee) { + this.txsFee = txsFee; + return this; + } + + /** + * Get txsFee + * @return txsFee + */ + @javax.annotation.Nullable + public Integer getTxsFee() { + return txsFee; + } + + public void setTxsFee(@javax.annotation.Nullable Integer txsFee) { + this.txsFee = txsFee; + } + + + public BlockTemplateModel prevHash(@javax.annotation.Nullable String prevHash) { + this.prevHash = prevHash; + return this; + } + + /** + * Get prevHash + * @return prevHash + */ + @javax.annotation.Nullable + public String getPrevHash() { + return prevHash; + } + + public void setPrevHash(@javax.annotation.Nullable String prevHash) { + this.prevHash = prevHash; + } + + + public BlockTemplateModel seed(@javax.annotation.Nullable String seed) { + this.seed = seed; + return this; + } + + /** + * Get seed + * @return seed + */ + @javax.annotation.Nullable + public String getSeed() { + return seed; + } + + public void setSeed(@javax.annotation.Nullable String seed) { + this.seed = seed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BlockTemplateModel blockTemplateModel = (BlockTemplateModel) o; + return Objects.equals(this.blocktemplateBlob, blockTemplateModel.blocktemplateBlob) && + Objects.equals(this.difficulty, blockTemplateModel.difficulty) && + Objects.equals(this.height, blockTemplateModel.height) && + Objects.equals(this.minerTxTgc, blockTemplateModel.minerTxTgc) && + Objects.equals(this.blockRewardWithoutFee, blockTemplateModel.blockRewardWithoutFee) && + Objects.equals(this.blockReward, blockTemplateModel.blockReward) && + Objects.equals(this.txsFee, blockTemplateModel.txsFee) && + Objects.equals(this.prevHash, blockTemplateModel.prevHash) && + Objects.equals(this.seed, blockTemplateModel.seed); + } + + @Override + public int hashCode() { + return Objects.hash(blocktemplateBlob, difficulty, height, minerTxTgc, blockRewardWithoutFee, blockReward, txsFee, prevHash, seed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BlockTemplateModel {\n"); + sb.append(" blocktemplateBlob: ").append(toIndentedString(blocktemplateBlob)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" minerTxTgc: ").append(toIndentedString(minerTxTgc)).append("\n"); + sb.append(" blockRewardWithoutFee: ").append(toIndentedString(blockRewardWithoutFee)).append("\n"); + sb.append(" blockReward: ").append(toIndentedString(blockReward)).append("\n"); + sb.append(" txsFee: ").append(toIndentedString(txsFee)).append("\n"); + sb.append(" prevHash: ").append(toIndentedString(prevHash)).append("\n"); + sb.append(" seed: ").append(toIndentedString(seed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("blocktemplate_blob", "difficulty", "height", "miner_tx_tgc", "block_reward_without_fee", "block_reward", "txs_fee", "prev_hash", "seed")); + + // 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 BlockTemplateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BlockTemplateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BlockTemplateModel is not found in the empty JSON string", BlockTemplateModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BlockTemplateModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BlockTemplateModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("blocktemplate_blob") != null && !jsonObj.get("blocktemplate_blob").isJsonNull()) && !jsonObj.get("blocktemplate_blob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `blocktemplate_blob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blocktemplate_blob").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + // validate the optional field `miner_tx_tgc` + if (jsonObj.get("miner_tx_tgc") != null && !jsonObj.get("miner_tx_tgc").isJsonNull()) { + TxGenerationContextModel.validateJsonElement(jsonObj.get("miner_tx_tgc")); + } + if ((jsonObj.get("prev_hash") != null && !jsonObj.get("prev_hash").isJsonNull()) && !jsonObj.get("prev_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `prev_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prev_hash").toString())); + } + if ((jsonObj.get("seed") != null && !jsonObj.get("seed").isJsonNull()) && !jsonObj.get("seed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `seed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("seed").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BlockTemplateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BlockTemplateModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BlockTemplateModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BlockTemplateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BlockTemplateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BlockTemplateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of BlockTemplateModel + * @throws IOException if the JSON string is invalid with respect to BlockTemplateModel + */ + public static BlockTemplateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BlockTemplateModel.class); + } + + /** + * Convert an instance of BlockTemplateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateRequestModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateRequestModel.java new file mode 100644 index 00000000..dcfe59a4 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/BlockTemplateRequestModel.java @@ -0,0 +1,388 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.PosEntryModel; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * BlockTemplateRequestModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class BlockTemplateRequestModel { + public static final String SERIALIZED_NAME_MINER_ADDRESS = "miner_address"; + @SerializedName(SERIALIZED_NAME_MINER_ADDRESS) + @javax.annotation.Nullable + private String minerAddress; + + public static final String SERIALIZED_NAME_STAKEHOLDER_ADDRESS = "stakeholder_address"; + @SerializedName(SERIALIZED_NAME_STAKEHOLDER_ADDRESS) + @javax.annotation.Nullable + private String stakeholderAddress; + + public static final String SERIALIZED_NAME_EX_NONCE = "ex_nonce"; + @SerializedName(SERIALIZED_NAME_EX_NONCE) + @javax.annotation.Nullable + private String exNonce; + + public static final String SERIALIZED_NAME_POS_BLOCK = "pos_block"; + @SerializedName(SERIALIZED_NAME_POS_BLOCK) + @javax.annotation.Nullable + private Boolean posBlock; + + public static final String SERIALIZED_NAME_IGNORE_POW_TS_CHECK = "ignore_pow_ts_check"; + @SerializedName(SERIALIZED_NAME_IGNORE_POW_TS_CHECK) + @javax.annotation.Nullable + private Boolean ignorePowTsCheck; + + public static final String SERIALIZED_NAME_PE = "pe"; + @SerializedName(SERIALIZED_NAME_PE) + @javax.annotation.Nullable + private PosEntryModel pe; + + public static final String SERIALIZED_NAME_EXPLICIT_TXS = "explicit_txs"; + @SerializedName(SERIALIZED_NAME_EXPLICIT_TXS) + @javax.annotation.Nullable + private List explicitTxs = new ArrayList<>(); + + public BlockTemplateRequestModel() { + } + + public BlockTemplateRequestModel minerAddress(@javax.annotation.Nullable String minerAddress) { + this.minerAddress = minerAddress; + return this; + } + + /** + * Get minerAddress + * @return minerAddress + */ + @javax.annotation.Nullable + public String getMinerAddress() { + return minerAddress; + } + + public void setMinerAddress(@javax.annotation.Nullable String minerAddress) { + this.minerAddress = minerAddress; + } + + + public BlockTemplateRequestModel stakeholderAddress(@javax.annotation.Nullable String stakeholderAddress) { + this.stakeholderAddress = stakeholderAddress; + return this; + } + + /** + * Get stakeholderAddress + * @return stakeholderAddress + */ + @javax.annotation.Nullable + public String getStakeholderAddress() { + return stakeholderAddress; + } + + public void setStakeholderAddress(@javax.annotation.Nullable String stakeholderAddress) { + this.stakeholderAddress = stakeholderAddress; + } + + + public BlockTemplateRequestModel exNonce(@javax.annotation.Nullable String exNonce) { + this.exNonce = exNonce; + return this; + } + + /** + * Get exNonce + * @return exNonce + */ + @javax.annotation.Nullable + public String getExNonce() { + return exNonce; + } + + public void setExNonce(@javax.annotation.Nullable String exNonce) { + this.exNonce = exNonce; + } + + + public BlockTemplateRequestModel posBlock(@javax.annotation.Nullable Boolean posBlock) { + this.posBlock = posBlock; + return this; + } + + /** + * Get posBlock + * @return posBlock + */ + @javax.annotation.Nullable + public Boolean getPosBlock() { + return posBlock; + } + + public void setPosBlock(@javax.annotation.Nullable Boolean posBlock) { + this.posBlock = posBlock; + } + + + public BlockTemplateRequestModel ignorePowTsCheck(@javax.annotation.Nullable Boolean ignorePowTsCheck) { + this.ignorePowTsCheck = ignorePowTsCheck; + return this; + } + + /** + * Get ignorePowTsCheck + * @return ignorePowTsCheck + */ + @javax.annotation.Nullable + public Boolean getIgnorePowTsCheck() { + return ignorePowTsCheck; + } + + public void setIgnorePowTsCheck(@javax.annotation.Nullable Boolean ignorePowTsCheck) { + this.ignorePowTsCheck = ignorePowTsCheck; + } + + + public BlockTemplateRequestModel pe(@javax.annotation.Nullable PosEntryModel pe) { + this.pe = pe; + return this; + } + + /** + * Get pe + * @return pe + */ + @javax.annotation.Nullable + public PosEntryModel getPe() { + return pe; + } + + public void setPe(@javax.annotation.Nullable PosEntryModel pe) { + this.pe = pe; + } + + + public BlockTemplateRequestModel explicitTxs(@javax.annotation.Nullable List explicitTxs) { + this.explicitTxs = explicitTxs; + return this; + } + + public BlockTemplateRequestModel addExplicitTxsItem(String explicitTxsItem) { + if (this.explicitTxs == null) { + this.explicitTxs = new ArrayList<>(); + } + this.explicitTxs.add(explicitTxsItem); + return this; + } + + /** + * Get explicitTxs + * @return explicitTxs + */ + @javax.annotation.Nullable + public List getExplicitTxs() { + return explicitTxs; + } + + public void setExplicitTxs(@javax.annotation.Nullable List explicitTxs) { + this.explicitTxs = explicitTxs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BlockTemplateRequestModel blockTemplateRequestModel = (BlockTemplateRequestModel) o; + return Objects.equals(this.minerAddress, blockTemplateRequestModel.minerAddress) && + Objects.equals(this.stakeholderAddress, blockTemplateRequestModel.stakeholderAddress) && + Objects.equals(this.exNonce, blockTemplateRequestModel.exNonce) && + Objects.equals(this.posBlock, blockTemplateRequestModel.posBlock) && + Objects.equals(this.ignorePowTsCheck, blockTemplateRequestModel.ignorePowTsCheck) && + Objects.equals(this.pe, blockTemplateRequestModel.pe) && + Objects.equals(this.explicitTxs, blockTemplateRequestModel.explicitTxs); + } + + @Override + public int hashCode() { + return Objects.hash(minerAddress, stakeholderAddress, exNonce, posBlock, ignorePowTsCheck, pe, explicitTxs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BlockTemplateRequestModel {\n"); + sb.append(" minerAddress: ").append(toIndentedString(minerAddress)).append("\n"); + sb.append(" stakeholderAddress: ").append(toIndentedString(stakeholderAddress)).append("\n"); + sb.append(" exNonce: ").append(toIndentedString(exNonce)).append("\n"); + sb.append(" posBlock: ").append(toIndentedString(posBlock)).append("\n"); + sb.append(" ignorePowTsCheck: ").append(toIndentedString(ignorePowTsCheck)).append("\n"); + sb.append(" pe: ").append(toIndentedString(pe)).append("\n"); + sb.append(" explicitTxs: ").append(toIndentedString(explicitTxs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("miner_address", "stakeholder_address", "ex_nonce", "pos_block", "ignore_pow_ts_check", "pe", "explicit_txs")); + + // 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 BlockTemplateRequestModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BlockTemplateRequestModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BlockTemplateRequestModel is not found in the empty JSON string", BlockTemplateRequestModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BlockTemplateRequestModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BlockTemplateRequestModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("miner_address") != null && !jsonObj.get("miner_address").isJsonNull()) && !jsonObj.get("miner_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `miner_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner_address").toString())); + } + if ((jsonObj.get("stakeholder_address") != null && !jsonObj.get("stakeholder_address").isJsonNull()) && !jsonObj.get("stakeholder_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `stakeholder_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stakeholder_address").toString())); + } + if ((jsonObj.get("ex_nonce") != null && !jsonObj.get("ex_nonce").isJsonNull()) && !jsonObj.get("ex_nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ex_nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ex_nonce").toString())); + } + // validate the optional field `pe` + if (jsonObj.get("pe") != null && !jsonObj.get("pe").isJsonNull()) { + PosEntryModel.validateJsonElement(jsonObj.get("pe")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("explicit_txs") != null && !jsonObj.get("explicit_txs").isJsonNull() && !jsonObj.get("explicit_txs").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `explicit_txs` to be an array in the JSON string but got `%s`", jsonObj.get("explicit_txs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BlockTemplateRequestModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BlockTemplateRequestModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BlockTemplateRequestModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BlockTemplateRequestModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BlockTemplateRequestModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BlockTemplateRequestModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of BlockTemplateRequestModel + * @throws IOException if the JSON string is invalid with respect to BlockTemplateRequestModel + */ + public static BlockTemplateRequestModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BlockTemplateRequestModel.class); + } + + /** + * Convert an instance of BlockTemplateRequestModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/DbStatInfoModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/DbStatInfoModel.java new file mode 100644 index 00000000..312c767d --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/DbStatInfoModel.java @@ -0,0 +1,256 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * DbStatInfoModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class DbStatInfoModel { + public static final String SERIALIZED_NAME_TX_COUNT = "tx_count"; + @SerializedName(SERIALIZED_NAME_TX_COUNT) + @javax.annotation.Nullable + private Integer txCount; + + public static final String SERIALIZED_NAME_WRITE_TX_COUNT = "write_tx_count"; + @SerializedName(SERIALIZED_NAME_WRITE_TX_COUNT) + @javax.annotation.Nullable + private Integer writeTxCount; + + public static final String SERIALIZED_NAME_MAP_SIZE = "map_size"; + @SerializedName(SERIALIZED_NAME_MAP_SIZE) + @javax.annotation.Nullable + private Integer mapSize; + + public DbStatInfoModel() { + } + + public DbStatInfoModel txCount(@javax.annotation.Nullable Integer txCount) { + this.txCount = txCount; + return this; + } + + /** + * Get txCount + * @return txCount + */ + @javax.annotation.Nullable + public Integer getTxCount() { + return txCount; + } + + public void setTxCount(@javax.annotation.Nullable Integer txCount) { + this.txCount = txCount; + } + + + public DbStatInfoModel writeTxCount(@javax.annotation.Nullable Integer writeTxCount) { + this.writeTxCount = writeTxCount; + return this; + } + + /** + * Get writeTxCount + * @return writeTxCount + */ + @javax.annotation.Nullable + public Integer getWriteTxCount() { + return writeTxCount; + } + + public void setWriteTxCount(@javax.annotation.Nullable Integer writeTxCount) { + this.writeTxCount = writeTxCount; + } + + + public DbStatInfoModel mapSize(@javax.annotation.Nullable Integer mapSize) { + this.mapSize = mapSize; + return this; + } + + /** + * Get mapSize + * @return mapSize + */ + @javax.annotation.Nullable + public Integer getMapSize() { + return mapSize; + } + + public void setMapSize(@javax.annotation.Nullable Integer mapSize) { + this.mapSize = mapSize; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DbStatInfoModel dbStatInfoModel = (DbStatInfoModel) o; + return Objects.equals(this.txCount, dbStatInfoModel.txCount) && + Objects.equals(this.writeTxCount, dbStatInfoModel.writeTxCount) && + Objects.equals(this.mapSize, dbStatInfoModel.mapSize); + } + + @Override + public int hashCode() { + return Objects.hash(txCount, writeTxCount, mapSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DbStatInfoModel {\n"); + sb.append(" txCount: ").append(toIndentedString(txCount)).append("\n"); + sb.append(" writeTxCount: ").append(toIndentedString(writeTxCount)).append("\n"); + sb.append(" mapSize: ").append(toIndentedString(mapSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("tx_count", "write_tx_count", "map_size")); + + // 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 DbStatInfoModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DbStatInfoModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in DbStatInfoModel is not found in the empty JSON string", DbStatInfoModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DbStatInfoModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `DbStatInfoModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DbStatInfoModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DbStatInfoModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DbStatInfoModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DbStatInfoModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DbStatInfoModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DbStatInfoModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of DbStatInfoModel + * @throws IOException if the JSON string is invalid with respect to DbStatInfoModel + */ + public static DbStatInfoModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DbStatInfoModel.class); + } + + /** + * Convert an instance of DbStatInfoModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/HeightModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/HeightModel.java new file mode 100644 index 00000000..1834418d --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/HeightModel.java @@ -0,0 +1,204 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * HeightModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class HeightModel { + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + @javax.annotation.Nullable + private Integer height; + + public HeightModel() { + } + + public HeightModel height(@javax.annotation.Nullable Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * @return height + */ + @javax.annotation.Nullable + public Integer getHeight() { + return height; + } + + public void setHeight(@javax.annotation.Nullable Integer height) { + this.height = height; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HeightModel heightModel = (HeightModel) o; + return Objects.equals(this.height, heightModel.height); + } + + @Override + public int hashCode() { + return Objects.hash(height); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HeightModel {\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("height")); + + // 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 HeightModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HeightModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in HeightModel is not found in the empty JSON string", HeightModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!HeightModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `HeightModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HeightModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HeightModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HeightModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HeightModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HeightModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HeightModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of HeightModel + * @throws IOException if the JSON string is invalid with respect to HeightModel + */ + public static HeightModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HeightModel.class); + } + + /** + * Convert an instance of HeightModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/InfoModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/InfoModel.java new file mode 100644 index 00000000..ac2da187 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/InfoModel.java @@ -0,0 +1,1444 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.MaintainersInfoModel; +import org.openapitools.client.model.PerformanceModel; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * InfoModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class InfoModel { + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + @javax.annotation.Nullable + private Integer height; + + public static final String SERIALIZED_NAME_TX_COUNT = "tx_count"; + @SerializedName(SERIALIZED_NAME_TX_COUNT) + @javax.annotation.Nullable + private Integer txCount; + + public static final String SERIALIZED_NAME_TX_POOL_SIZE = "tx_pool_size"; + @SerializedName(SERIALIZED_NAME_TX_POOL_SIZE) + @javax.annotation.Nullable + private Integer txPoolSize; + + public static final String SERIALIZED_NAME_ALT_BLOCKS_COUNT = "alt_blocks_count"; + @SerializedName(SERIALIZED_NAME_ALT_BLOCKS_COUNT) + @javax.annotation.Nullable + private Integer altBlocksCount; + + public static final String SERIALIZED_NAME_OUTGOING_CONNECTIONS_COUNT = "outgoing_connections_count"; + @SerializedName(SERIALIZED_NAME_OUTGOING_CONNECTIONS_COUNT) + @javax.annotation.Nullable + private Integer outgoingConnectionsCount; + + public static final String SERIALIZED_NAME_INCOMING_CONNECTIONS_COUNT = "incoming_connections_count"; + @SerializedName(SERIALIZED_NAME_INCOMING_CONNECTIONS_COUNT) + @javax.annotation.Nullable + private Integer incomingConnectionsCount; + + public static final String SERIALIZED_NAME_SYNCHRONIZED_CONNECTIONS_COUNT = "synchronized_connections_count"; + @SerializedName(SERIALIZED_NAME_SYNCHRONIZED_CONNECTIONS_COUNT) + @javax.annotation.Nullable + private Integer synchronizedConnectionsCount; + + public static final String SERIALIZED_NAME_WHITE_PEERLIST_SIZE = "white_peerlist_size"; + @SerializedName(SERIALIZED_NAME_WHITE_PEERLIST_SIZE) + @javax.annotation.Nullable + private Integer whitePeerlistSize; + + public static final String SERIALIZED_NAME_GREY_PEERLIST_SIZE = "grey_peerlist_size"; + @SerializedName(SERIALIZED_NAME_GREY_PEERLIST_SIZE) + @javax.annotation.Nullable + private Integer greyPeerlistSize; + + public static final String SERIALIZED_NAME_CURRENT_BLOCKS_MEDIAN = "current_blocks_median"; + @SerializedName(SERIALIZED_NAME_CURRENT_BLOCKS_MEDIAN) + @javax.annotation.Nullable + private Integer currentBlocksMedian; + + public static final String SERIALIZED_NAME_ALIAS_COUNT = "alias_count"; + @SerializedName(SERIALIZED_NAME_ALIAS_COUNT) + @javax.annotation.Nullable + private Integer aliasCount; + + public static final String SERIALIZED_NAME_CURRENT_MAX_ALLOWED_BLOCK_SIZE = "current_max_allowed_block_size"; + @SerializedName(SERIALIZED_NAME_CURRENT_MAX_ALLOWED_BLOCK_SIZE) + @javax.annotation.Nullable + private Integer currentMaxAllowedBlockSize; + + public static final String SERIALIZED_NAME_DAEMON_NETWORK_STATE = "daemon_network_state"; + @SerializedName(SERIALIZED_NAME_DAEMON_NETWORK_STATE) + @javax.annotation.Nullable + private String daemonNetworkState; + + public static final String SERIALIZED_NAME_SYNCHRONIZATION_START_HEIGHT = "synchronization_start_height"; + @SerializedName(SERIALIZED_NAME_SYNCHRONIZATION_START_HEIGHT) + @javax.annotation.Nullable + private Integer synchronizationStartHeight; + + public static final String SERIALIZED_NAME_MAX_NET_SEEN_HEIGHT = "max_net_seen_height"; + @SerializedName(SERIALIZED_NAME_MAX_NET_SEEN_HEIGHT) + @javax.annotation.Nullable + private Integer maxNetSeenHeight; + + public static final String SERIALIZED_NAME_MI = "mi"; + @SerializedName(SERIALIZED_NAME_MI) + @javax.annotation.Nullable + private MaintainersInfoModel mi; + + public static final String SERIALIZED_NAME_POS_ALLOWED = "pos_allowed"; + @SerializedName(SERIALIZED_NAME_POS_ALLOWED) + @javax.annotation.Nullable + private Boolean posAllowed; + + public static final String SERIALIZED_NAME_POS_DIFFICULTY = "pos_difficulty"; + @SerializedName(SERIALIZED_NAME_POS_DIFFICULTY) + @javax.annotation.Nullable + private String posDifficulty; + + public static final String SERIALIZED_NAME_POW_DIFFICULTY = "pow_difficulty"; + @SerializedName(SERIALIZED_NAME_POW_DIFFICULTY) + @javax.annotation.Nullable + private Integer powDifficulty; + + public static final String SERIALIZED_NAME_DEFAULT_FEE = "default_fee"; + @SerializedName(SERIALIZED_NAME_DEFAULT_FEE) + @javax.annotation.Nullable + private Integer defaultFee; + + public static final String SERIALIZED_NAME_MINIMUM_FEE = "minimum_fee"; + @SerializedName(SERIALIZED_NAME_MINIMUM_FEE) + @javax.annotation.Nullable + private Integer minimumFee; + + public static final String SERIALIZED_NAME_IS_HARDFORK_ACTIVE = "is_hardfork_active"; + @SerializedName(SERIALIZED_NAME_IS_HARDFORK_ACTIVE) + @javax.annotation.Nullable + private List isHardforkActive = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NET_TIME_DELTA_MEDIAN = "net_time_delta_median"; + @SerializedName(SERIALIZED_NAME_NET_TIME_DELTA_MEDIAN) + @javax.annotation.Nullable + private Long netTimeDeltaMedian; + + public static final String SERIALIZED_NAME_CURRENT_NETWORK_HASHRATE50 = "current_network_hashrate_50"; + @SerializedName(SERIALIZED_NAME_CURRENT_NETWORK_HASHRATE50) + @javax.annotation.Nullable + private Integer currentNetworkHashrate50; + + public static final String SERIALIZED_NAME_CURRENT_NETWORK_HASHRATE350 = "current_network_hashrate_350"; + @SerializedName(SERIALIZED_NAME_CURRENT_NETWORK_HASHRATE350) + @javax.annotation.Nullable + private Integer currentNetworkHashrate350; + + public static final String SERIALIZED_NAME_SECONDS_FOR10_BLOCKS = "seconds_for_10_blocks"; + @SerializedName(SERIALIZED_NAME_SECONDS_FOR10_BLOCKS) + @javax.annotation.Nullable + private Integer secondsFor10Blocks; + + public static final String SERIALIZED_NAME_SECONDS_FOR30_BLOCKS = "seconds_for_30_blocks"; + @SerializedName(SERIALIZED_NAME_SECONDS_FOR30_BLOCKS) + @javax.annotation.Nullable + private Integer secondsFor30Blocks; + + public static final String SERIALIZED_NAME_TRANSACTIONS_CNT_PER_DAY = "transactions_cnt_per_day"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_CNT_PER_DAY) + @javax.annotation.Nullable + private List transactionsCntPerDay = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TRANSACTIONS_VOLUME_PER_DAY = "transactions_volume_per_day"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_VOLUME_PER_DAY) + @javax.annotation.Nullable + private List transactionsVolumePerDay = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LAST_POS_TIMESTAMP = "last_pos_timestamp"; + @SerializedName(SERIALIZED_NAME_LAST_POS_TIMESTAMP) + @javax.annotation.Nullable + private Integer lastPosTimestamp; + + public static final String SERIALIZED_NAME_LAST_POW_TIMESTAMP = "last_pow_timestamp"; + @SerializedName(SERIALIZED_NAME_LAST_POW_TIMESTAMP) + @javax.annotation.Nullable + private Integer lastPowTimestamp; + + public static final String SERIALIZED_NAME_TOTAL_COINS = "total_coins"; + @SerializedName(SERIALIZED_NAME_TOTAL_COINS) + @javax.annotation.Nullable + private String totalCoins; + + public static final String SERIALIZED_NAME_LAST_BLOCK_SIZE = "last_block_size"; + @SerializedName(SERIALIZED_NAME_LAST_BLOCK_SIZE) + @javax.annotation.Nullable + private Integer lastBlockSize; + + public static final String SERIALIZED_NAME_TX_COUNT_IN_LAST_BLOCK = "tx_count_in_last_block"; + @SerializedName(SERIALIZED_NAME_TX_COUNT_IN_LAST_BLOCK) + @javax.annotation.Nullable + private Integer txCountInLastBlock; + + public static final String SERIALIZED_NAME_POS_SEQUENCE_FACTOR = "pos_sequence_factor"; + @SerializedName(SERIALIZED_NAME_POS_SEQUENCE_FACTOR) + @javax.annotation.Nullable + private Double posSequenceFactor; + + public static final String SERIALIZED_NAME_POW_SEQUENCE_FACTOR = "pow_sequence_factor"; + @SerializedName(SERIALIZED_NAME_POW_SEQUENCE_FACTOR) + @javax.annotation.Nullable + private Double powSequenceFactor; + + public static final String SERIALIZED_NAME_BLOCK_REWARD = "block_reward"; + @SerializedName(SERIALIZED_NAME_BLOCK_REWARD) + @javax.annotation.Nullable + private Integer blockReward; + + public static final String SERIALIZED_NAME_LAST_BLOCK_TOTAL_REWARD = "last_block_total_reward"; + @SerializedName(SERIALIZED_NAME_LAST_BLOCK_TOTAL_REWARD) + @javax.annotation.Nullable + private Integer lastBlockTotalReward; + + public static final String SERIALIZED_NAME_POS_DIFF_TOTAL_COINS_RATE = "pos_diff_total_coins_rate"; + @SerializedName(SERIALIZED_NAME_POS_DIFF_TOTAL_COINS_RATE) + @javax.annotation.Nullable + private Integer posDiffTotalCoinsRate; + + public static final String SERIALIZED_NAME_LAST_BLOCK_TIMESTAMP = "last_block_timestamp"; + @SerializedName(SERIALIZED_NAME_LAST_BLOCK_TIMESTAMP) + @javax.annotation.Nullable + private Integer lastBlockTimestamp; + + public static final String SERIALIZED_NAME_LAST_BLOCK_HASH = "last_block_hash"; + @SerializedName(SERIALIZED_NAME_LAST_BLOCK_HASH) + @javax.annotation.Nullable + private String lastBlockHash; + + public static final String SERIALIZED_NAME_POS_BLOCK_TS_SHIFT_VS_ACTUAL = "pos_block_ts_shift_vs_actual"; + @SerializedName(SERIALIZED_NAME_POS_BLOCK_TS_SHIFT_VS_ACTUAL) + @javax.annotation.Nullable + private Long posBlockTsShiftVsActual; + + public static final String SERIALIZED_NAME_OUTS_STAT = "outs_stat"; + @SerializedName(SERIALIZED_NAME_OUTS_STAT) + @javax.annotation.Nullable + private Map outsStat = new HashMap<>(); + + public static final String SERIALIZED_NAME_PERFORMANCE_DATA = "performance_data"; + @SerializedName(SERIALIZED_NAME_PERFORMANCE_DATA) + @javax.annotation.Nullable + private PerformanceModel performanceData; + + public static final String SERIALIZED_NAME_OFFERS_COUNT = "offers_count"; + @SerializedName(SERIALIZED_NAME_OFFERS_COUNT) + @javax.annotation.Nullable + private Integer offersCount; + + public static final String SERIALIZED_NAME_EXPIRATION_MEDIAN_TIMESTAMP = "expiration_median_timestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_MEDIAN_TIMESTAMP) + @javax.annotation.Nullable + private Integer expirationMedianTimestamp; + + public InfoModel() { + } + + public InfoModel height(@javax.annotation.Nullable Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * @return height + */ + @javax.annotation.Nullable + public Integer getHeight() { + return height; + } + + public void setHeight(@javax.annotation.Nullable Integer height) { + this.height = height; + } + + + public InfoModel txCount(@javax.annotation.Nullable Integer txCount) { + this.txCount = txCount; + return this; + } + + /** + * Get txCount + * @return txCount + */ + @javax.annotation.Nullable + public Integer getTxCount() { + return txCount; + } + + public void setTxCount(@javax.annotation.Nullable Integer txCount) { + this.txCount = txCount; + } + + + public InfoModel txPoolSize(@javax.annotation.Nullable Integer txPoolSize) { + this.txPoolSize = txPoolSize; + return this; + } + + /** + * Get txPoolSize + * @return txPoolSize + */ + @javax.annotation.Nullable + public Integer getTxPoolSize() { + return txPoolSize; + } + + public void setTxPoolSize(@javax.annotation.Nullable Integer txPoolSize) { + this.txPoolSize = txPoolSize; + } + + + public InfoModel altBlocksCount(@javax.annotation.Nullable Integer altBlocksCount) { + this.altBlocksCount = altBlocksCount; + return this; + } + + /** + * Get altBlocksCount + * @return altBlocksCount + */ + @javax.annotation.Nullable + public Integer getAltBlocksCount() { + return altBlocksCount; + } + + public void setAltBlocksCount(@javax.annotation.Nullable Integer altBlocksCount) { + this.altBlocksCount = altBlocksCount; + } + + + public InfoModel outgoingConnectionsCount(@javax.annotation.Nullable Integer outgoingConnectionsCount) { + this.outgoingConnectionsCount = outgoingConnectionsCount; + return this; + } + + /** + * Get outgoingConnectionsCount + * @return outgoingConnectionsCount + */ + @javax.annotation.Nullable + public Integer getOutgoingConnectionsCount() { + return outgoingConnectionsCount; + } + + public void setOutgoingConnectionsCount(@javax.annotation.Nullable Integer outgoingConnectionsCount) { + this.outgoingConnectionsCount = outgoingConnectionsCount; + } + + + public InfoModel incomingConnectionsCount(@javax.annotation.Nullable Integer incomingConnectionsCount) { + this.incomingConnectionsCount = incomingConnectionsCount; + return this; + } + + /** + * Get incomingConnectionsCount + * @return incomingConnectionsCount + */ + @javax.annotation.Nullable + public Integer getIncomingConnectionsCount() { + return incomingConnectionsCount; + } + + public void setIncomingConnectionsCount(@javax.annotation.Nullable Integer incomingConnectionsCount) { + this.incomingConnectionsCount = incomingConnectionsCount; + } + + + public InfoModel synchronizedConnectionsCount(@javax.annotation.Nullable Integer synchronizedConnectionsCount) { + this.synchronizedConnectionsCount = synchronizedConnectionsCount; + return this; + } + + /** + * Get synchronizedConnectionsCount + * @return synchronizedConnectionsCount + */ + @javax.annotation.Nullable + public Integer getSynchronizedConnectionsCount() { + return synchronizedConnectionsCount; + } + + public void setSynchronizedConnectionsCount(@javax.annotation.Nullable Integer synchronizedConnectionsCount) { + this.synchronizedConnectionsCount = synchronizedConnectionsCount; + } + + + public InfoModel whitePeerlistSize(@javax.annotation.Nullable Integer whitePeerlistSize) { + this.whitePeerlistSize = whitePeerlistSize; + return this; + } + + /** + * Get whitePeerlistSize + * @return whitePeerlistSize + */ + @javax.annotation.Nullable + public Integer getWhitePeerlistSize() { + return whitePeerlistSize; + } + + public void setWhitePeerlistSize(@javax.annotation.Nullable Integer whitePeerlistSize) { + this.whitePeerlistSize = whitePeerlistSize; + } + + + public InfoModel greyPeerlistSize(@javax.annotation.Nullable Integer greyPeerlistSize) { + this.greyPeerlistSize = greyPeerlistSize; + return this; + } + + /** + * Get greyPeerlistSize + * @return greyPeerlistSize + */ + @javax.annotation.Nullable + public Integer getGreyPeerlistSize() { + return greyPeerlistSize; + } + + public void setGreyPeerlistSize(@javax.annotation.Nullable Integer greyPeerlistSize) { + this.greyPeerlistSize = greyPeerlistSize; + } + + + public InfoModel currentBlocksMedian(@javax.annotation.Nullable Integer currentBlocksMedian) { + this.currentBlocksMedian = currentBlocksMedian; + return this; + } + + /** + * Get currentBlocksMedian + * @return currentBlocksMedian + */ + @javax.annotation.Nullable + public Integer getCurrentBlocksMedian() { + return currentBlocksMedian; + } + + public void setCurrentBlocksMedian(@javax.annotation.Nullable Integer currentBlocksMedian) { + this.currentBlocksMedian = currentBlocksMedian; + } + + + public InfoModel aliasCount(@javax.annotation.Nullable Integer aliasCount) { + this.aliasCount = aliasCount; + return this; + } + + /** + * Get aliasCount + * @return aliasCount + */ + @javax.annotation.Nullable + public Integer getAliasCount() { + return aliasCount; + } + + public void setAliasCount(@javax.annotation.Nullable Integer aliasCount) { + this.aliasCount = aliasCount; + } + + + public InfoModel currentMaxAllowedBlockSize(@javax.annotation.Nullable Integer currentMaxAllowedBlockSize) { + this.currentMaxAllowedBlockSize = currentMaxAllowedBlockSize; + return this; + } + + /** + * Get currentMaxAllowedBlockSize + * @return currentMaxAllowedBlockSize + */ + @javax.annotation.Nullable + public Integer getCurrentMaxAllowedBlockSize() { + return currentMaxAllowedBlockSize; + } + + public void setCurrentMaxAllowedBlockSize(@javax.annotation.Nullable Integer currentMaxAllowedBlockSize) { + this.currentMaxAllowedBlockSize = currentMaxAllowedBlockSize; + } + + + public InfoModel daemonNetworkState(@javax.annotation.Nullable String daemonNetworkState) { + this.daemonNetworkState = daemonNetworkState; + return this; + } + + /** + * Get daemonNetworkState + * @return daemonNetworkState + */ + @javax.annotation.Nullable + public String getDaemonNetworkState() { + return daemonNetworkState; + } + + public void setDaemonNetworkState(@javax.annotation.Nullable String daemonNetworkState) { + this.daemonNetworkState = daemonNetworkState; + } + + + public InfoModel synchronizationStartHeight(@javax.annotation.Nullable Integer synchronizationStartHeight) { + this.synchronizationStartHeight = synchronizationStartHeight; + return this; + } + + /** + * Get synchronizationStartHeight + * @return synchronizationStartHeight + */ + @javax.annotation.Nullable + public Integer getSynchronizationStartHeight() { + return synchronizationStartHeight; + } + + public void setSynchronizationStartHeight(@javax.annotation.Nullable Integer synchronizationStartHeight) { + this.synchronizationStartHeight = synchronizationStartHeight; + } + + + public InfoModel maxNetSeenHeight(@javax.annotation.Nullable Integer maxNetSeenHeight) { + this.maxNetSeenHeight = maxNetSeenHeight; + return this; + } + + /** + * Get maxNetSeenHeight + * @return maxNetSeenHeight + */ + @javax.annotation.Nullable + public Integer getMaxNetSeenHeight() { + return maxNetSeenHeight; + } + + public void setMaxNetSeenHeight(@javax.annotation.Nullable Integer maxNetSeenHeight) { + this.maxNetSeenHeight = maxNetSeenHeight; + } + + + public InfoModel mi(@javax.annotation.Nullable MaintainersInfoModel mi) { + this.mi = mi; + return this; + } + + /** + * Get mi + * @return mi + */ + @javax.annotation.Nullable + public MaintainersInfoModel getMi() { + return mi; + } + + public void setMi(@javax.annotation.Nullable MaintainersInfoModel mi) { + this.mi = mi; + } + + + public InfoModel posAllowed(@javax.annotation.Nullable Boolean posAllowed) { + this.posAllowed = posAllowed; + return this; + } + + /** + * Get posAllowed + * @return posAllowed + */ + @javax.annotation.Nullable + public Boolean getPosAllowed() { + return posAllowed; + } + + public void setPosAllowed(@javax.annotation.Nullable Boolean posAllowed) { + this.posAllowed = posAllowed; + } + + + public InfoModel posDifficulty(@javax.annotation.Nullable String posDifficulty) { + this.posDifficulty = posDifficulty; + return this; + } + + /** + * Get posDifficulty + * @return posDifficulty + */ + @javax.annotation.Nullable + public String getPosDifficulty() { + return posDifficulty; + } + + public void setPosDifficulty(@javax.annotation.Nullable String posDifficulty) { + this.posDifficulty = posDifficulty; + } + + + public InfoModel powDifficulty(@javax.annotation.Nullable Integer powDifficulty) { + this.powDifficulty = powDifficulty; + return this; + } + + /** + * Get powDifficulty + * @return powDifficulty + */ + @javax.annotation.Nullable + public Integer getPowDifficulty() { + return powDifficulty; + } + + public void setPowDifficulty(@javax.annotation.Nullable Integer powDifficulty) { + this.powDifficulty = powDifficulty; + } + + + public InfoModel defaultFee(@javax.annotation.Nullable Integer defaultFee) { + this.defaultFee = defaultFee; + return this; + } + + /** + * Get defaultFee + * @return defaultFee + */ + @javax.annotation.Nullable + public Integer getDefaultFee() { + return defaultFee; + } + + public void setDefaultFee(@javax.annotation.Nullable Integer defaultFee) { + this.defaultFee = defaultFee; + } + + + public InfoModel minimumFee(@javax.annotation.Nullable Integer minimumFee) { + this.minimumFee = minimumFee; + return this; + } + + /** + * Get minimumFee + * @return minimumFee + */ + @javax.annotation.Nullable + public Integer getMinimumFee() { + return minimumFee; + } + + public void setMinimumFee(@javax.annotation.Nullable Integer minimumFee) { + this.minimumFee = minimumFee; + } + + + public InfoModel isHardforkActive(@javax.annotation.Nullable List isHardforkActive) { + this.isHardforkActive = isHardforkActive; + return this; + } + + public InfoModel addIsHardforkActiveItem(Boolean isHardforkActiveItem) { + if (this.isHardforkActive == null) { + this.isHardforkActive = new ArrayList<>(); + } + this.isHardforkActive.add(isHardforkActiveItem); + return this; + } + + /** + * Get isHardforkActive + * @return isHardforkActive + */ + @javax.annotation.Nullable + public List getIsHardforkActive() { + return isHardforkActive; + } + + public void setIsHardforkActive(@javax.annotation.Nullable List isHardforkActive) { + this.isHardforkActive = isHardforkActive; + } + + + public InfoModel netTimeDeltaMedian(@javax.annotation.Nullable Long netTimeDeltaMedian) { + this.netTimeDeltaMedian = netTimeDeltaMedian; + return this; + } + + /** + * Get netTimeDeltaMedian + * @return netTimeDeltaMedian + */ + @javax.annotation.Nullable + public Long getNetTimeDeltaMedian() { + return netTimeDeltaMedian; + } + + public void setNetTimeDeltaMedian(@javax.annotation.Nullable Long netTimeDeltaMedian) { + this.netTimeDeltaMedian = netTimeDeltaMedian; + } + + + public InfoModel currentNetworkHashrate50(@javax.annotation.Nullable Integer currentNetworkHashrate50) { + this.currentNetworkHashrate50 = currentNetworkHashrate50; + return this; + } + + /** + * Get currentNetworkHashrate50 + * @return currentNetworkHashrate50 + */ + @javax.annotation.Nullable + public Integer getCurrentNetworkHashrate50() { + return currentNetworkHashrate50; + } + + public void setCurrentNetworkHashrate50(@javax.annotation.Nullable Integer currentNetworkHashrate50) { + this.currentNetworkHashrate50 = currentNetworkHashrate50; + } + + + public InfoModel currentNetworkHashrate350(@javax.annotation.Nullable Integer currentNetworkHashrate350) { + this.currentNetworkHashrate350 = currentNetworkHashrate350; + return this; + } + + /** + * Get currentNetworkHashrate350 + * @return currentNetworkHashrate350 + */ + @javax.annotation.Nullable + public Integer getCurrentNetworkHashrate350() { + return currentNetworkHashrate350; + } + + public void setCurrentNetworkHashrate350(@javax.annotation.Nullable Integer currentNetworkHashrate350) { + this.currentNetworkHashrate350 = currentNetworkHashrate350; + } + + + public InfoModel secondsFor10Blocks(@javax.annotation.Nullable Integer secondsFor10Blocks) { + this.secondsFor10Blocks = secondsFor10Blocks; + return this; + } + + /** + * Get secondsFor10Blocks + * @return secondsFor10Blocks + */ + @javax.annotation.Nullable + public Integer getSecondsFor10Blocks() { + return secondsFor10Blocks; + } + + public void setSecondsFor10Blocks(@javax.annotation.Nullable Integer secondsFor10Blocks) { + this.secondsFor10Blocks = secondsFor10Blocks; + } + + + public InfoModel secondsFor30Blocks(@javax.annotation.Nullable Integer secondsFor30Blocks) { + this.secondsFor30Blocks = secondsFor30Blocks; + return this; + } + + /** + * Get secondsFor30Blocks + * @return secondsFor30Blocks + */ + @javax.annotation.Nullable + public Integer getSecondsFor30Blocks() { + return secondsFor30Blocks; + } + + public void setSecondsFor30Blocks(@javax.annotation.Nullable Integer secondsFor30Blocks) { + this.secondsFor30Blocks = secondsFor30Blocks; + } + + + public InfoModel transactionsCntPerDay(@javax.annotation.Nullable List transactionsCntPerDay) { + this.transactionsCntPerDay = transactionsCntPerDay; + return this; + } + + public InfoModel addTransactionsCntPerDayItem(Integer transactionsCntPerDayItem) { + if (this.transactionsCntPerDay == null) { + this.transactionsCntPerDay = new ArrayList<>(); + } + this.transactionsCntPerDay.add(transactionsCntPerDayItem); + return this; + } + + /** + * Get transactionsCntPerDay + * @return transactionsCntPerDay + */ + @javax.annotation.Nullable + public List getTransactionsCntPerDay() { + return transactionsCntPerDay; + } + + public void setTransactionsCntPerDay(@javax.annotation.Nullable List transactionsCntPerDay) { + this.transactionsCntPerDay = transactionsCntPerDay; + } + + + public InfoModel transactionsVolumePerDay(@javax.annotation.Nullable List transactionsVolumePerDay) { + this.transactionsVolumePerDay = transactionsVolumePerDay; + return this; + } + + public InfoModel addTransactionsVolumePerDayItem(Integer transactionsVolumePerDayItem) { + if (this.transactionsVolumePerDay == null) { + this.transactionsVolumePerDay = new ArrayList<>(); + } + this.transactionsVolumePerDay.add(transactionsVolumePerDayItem); + return this; + } + + /** + * Get transactionsVolumePerDay + * @return transactionsVolumePerDay + */ + @javax.annotation.Nullable + public List getTransactionsVolumePerDay() { + return transactionsVolumePerDay; + } + + public void setTransactionsVolumePerDay(@javax.annotation.Nullable List transactionsVolumePerDay) { + this.transactionsVolumePerDay = transactionsVolumePerDay; + } + + + public InfoModel lastPosTimestamp(@javax.annotation.Nullable Integer lastPosTimestamp) { + this.lastPosTimestamp = lastPosTimestamp; + return this; + } + + /** + * Get lastPosTimestamp + * @return lastPosTimestamp + */ + @javax.annotation.Nullable + public Integer getLastPosTimestamp() { + return lastPosTimestamp; + } + + public void setLastPosTimestamp(@javax.annotation.Nullable Integer lastPosTimestamp) { + this.lastPosTimestamp = lastPosTimestamp; + } + + + public InfoModel lastPowTimestamp(@javax.annotation.Nullable Integer lastPowTimestamp) { + this.lastPowTimestamp = lastPowTimestamp; + return this; + } + + /** + * Get lastPowTimestamp + * @return lastPowTimestamp + */ + @javax.annotation.Nullable + public Integer getLastPowTimestamp() { + return lastPowTimestamp; + } + + public void setLastPowTimestamp(@javax.annotation.Nullable Integer lastPowTimestamp) { + this.lastPowTimestamp = lastPowTimestamp; + } + + + public InfoModel totalCoins(@javax.annotation.Nullable String totalCoins) { + this.totalCoins = totalCoins; + return this; + } + + /** + * Get totalCoins + * @return totalCoins + */ + @javax.annotation.Nullable + public String getTotalCoins() { + return totalCoins; + } + + public void setTotalCoins(@javax.annotation.Nullable String totalCoins) { + this.totalCoins = totalCoins; + } + + + public InfoModel lastBlockSize(@javax.annotation.Nullable Integer lastBlockSize) { + this.lastBlockSize = lastBlockSize; + return this; + } + + /** + * Get lastBlockSize + * @return lastBlockSize + */ + @javax.annotation.Nullable + public Integer getLastBlockSize() { + return lastBlockSize; + } + + public void setLastBlockSize(@javax.annotation.Nullable Integer lastBlockSize) { + this.lastBlockSize = lastBlockSize; + } + + + public InfoModel txCountInLastBlock(@javax.annotation.Nullable Integer txCountInLastBlock) { + this.txCountInLastBlock = txCountInLastBlock; + return this; + } + + /** + * Get txCountInLastBlock + * @return txCountInLastBlock + */ + @javax.annotation.Nullable + public Integer getTxCountInLastBlock() { + return txCountInLastBlock; + } + + public void setTxCountInLastBlock(@javax.annotation.Nullable Integer txCountInLastBlock) { + this.txCountInLastBlock = txCountInLastBlock; + } + + + public InfoModel posSequenceFactor(@javax.annotation.Nullable Double posSequenceFactor) { + this.posSequenceFactor = posSequenceFactor; + return this; + } + + /** + * Get posSequenceFactor + * @return posSequenceFactor + */ + @javax.annotation.Nullable + public Double getPosSequenceFactor() { + return posSequenceFactor; + } + + public void setPosSequenceFactor(@javax.annotation.Nullable Double posSequenceFactor) { + this.posSequenceFactor = posSequenceFactor; + } + + + public InfoModel powSequenceFactor(@javax.annotation.Nullable Double powSequenceFactor) { + this.powSequenceFactor = powSequenceFactor; + return this; + } + + /** + * Get powSequenceFactor + * @return powSequenceFactor + */ + @javax.annotation.Nullable + public Double getPowSequenceFactor() { + return powSequenceFactor; + } + + public void setPowSequenceFactor(@javax.annotation.Nullable Double powSequenceFactor) { + this.powSequenceFactor = powSequenceFactor; + } + + + public InfoModel blockReward(@javax.annotation.Nullable Integer blockReward) { + this.blockReward = blockReward; + return this; + } + + /** + * Get blockReward + * @return blockReward + */ + @javax.annotation.Nullable + public Integer getBlockReward() { + return blockReward; + } + + public void setBlockReward(@javax.annotation.Nullable Integer blockReward) { + this.blockReward = blockReward; + } + + + public InfoModel lastBlockTotalReward(@javax.annotation.Nullable Integer lastBlockTotalReward) { + this.lastBlockTotalReward = lastBlockTotalReward; + return this; + } + + /** + * Get lastBlockTotalReward + * @return lastBlockTotalReward + */ + @javax.annotation.Nullable + public Integer getLastBlockTotalReward() { + return lastBlockTotalReward; + } + + public void setLastBlockTotalReward(@javax.annotation.Nullable Integer lastBlockTotalReward) { + this.lastBlockTotalReward = lastBlockTotalReward; + } + + + public InfoModel posDiffTotalCoinsRate(@javax.annotation.Nullable Integer posDiffTotalCoinsRate) { + this.posDiffTotalCoinsRate = posDiffTotalCoinsRate; + return this; + } + + /** + * Get posDiffTotalCoinsRate + * @return posDiffTotalCoinsRate + */ + @javax.annotation.Nullable + public Integer getPosDiffTotalCoinsRate() { + return posDiffTotalCoinsRate; + } + + public void setPosDiffTotalCoinsRate(@javax.annotation.Nullable Integer posDiffTotalCoinsRate) { + this.posDiffTotalCoinsRate = posDiffTotalCoinsRate; + } + + + public InfoModel lastBlockTimestamp(@javax.annotation.Nullable Integer lastBlockTimestamp) { + this.lastBlockTimestamp = lastBlockTimestamp; + return this; + } + + /** + * Get lastBlockTimestamp + * @return lastBlockTimestamp + */ + @javax.annotation.Nullable + public Integer getLastBlockTimestamp() { + return lastBlockTimestamp; + } + + public void setLastBlockTimestamp(@javax.annotation.Nullable Integer lastBlockTimestamp) { + this.lastBlockTimestamp = lastBlockTimestamp; + } + + + public InfoModel lastBlockHash(@javax.annotation.Nullable String lastBlockHash) { + this.lastBlockHash = lastBlockHash; + return this; + } + + /** + * Get lastBlockHash + * @return lastBlockHash + */ + @javax.annotation.Nullable + public String getLastBlockHash() { + return lastBlockHash; + } + + public void setLastBlockHash(@javax.annotation.Nullable String lastBlockHash) { + this.lastBlockHash = lastBlockHash; + } + + + public InfoModel posBlockTsShiftVsActual(@javax.annotation.Nullable Long posBlockTsShiftVsActual) { + this.posBlockTsShiftVsActual = posBlockTsShiftVsActual; + return this; + } + + /** + * Get posBlockTsShiftVsActual + * @return posBlockTsShiftVsActual + */ + @javax.annotation.Nullable + public Long getPosBlockTsShiftVsActual() { + return posBlockTsShiftVsActual; + } + + public void setPosBlockTsShiftVsActual(@javax.annotation.Nullable Long posBlockTsShiftVsActual) { + this.posBlockTsShiftVsActual = posBlockTsShiftVsActual; + } + + + public InfoModel outsStat(@javax.annotation.Nullable Map outsStat) { + this.outsStat = outsStat; + return this; + } + + public InfoModel putOutsStatItem(String key, Integer outsStatItem) { + if (this.outsStat == null) { + this.outsStat = new HashMap<>(); + } + this.outsStat.put(key, outsStatItem); + return this; + } + + /** + * Get outsStat + * @return outsStat + */ + @javax.annotation.Nullable + public Map getOutsStat() { + return outsStat; + } + + public void setOutsStat(@javax.annotation.Nullable Map outsStat) { + this.outsStat = outsStat; + } + + + public InfoModel performanceData(@javax.annotation.Nullable PerformanceModel performanceData) { + this.performanceData = performanceData; + return this; + } + + /** + * Get performanceData + * @return performanceData + */ + @javax.annotation.Nullable + public PerformanceModel getPerformanceData() { + return performanceData; + } + + public void setPerformanceData(@javax.annotation.Nullable PerformanceModel performanceData) { + this.performanceData = performanceData; + } + + + public InfoModel offersCount(@javax.annotation.Nullable Integer offersCount) { + this.offersCount = offersCount; + return this; + } + + /** + * Get offersCount + * @return offersCount + */ + @javax.annotation.Nullable + public Integer getOffersCount() { + return offersCount; + } + + public void setOffersCount(@javax.annotation.Nullable Integer offersCount) { + this.offersCount = offersCount; + } + + + public InfoModel expirationMedianTimestamp(@javax.annotation.Nullable Integer expirationMedianTimestamp) { + this.expirationMedianTimestamp = expirationMedianTimestamp; + return this; + } + + /** + * Get expirationMedianTimestamp + * @return expirationMedianTimestamp + */ + @javax.annotation.Nullable + public Integer getExpirationMedianTimestamp() { + return expirationMedianTimestamp; + } + + public void setExpirationMedianTimestamp(@javax.annotation.Nullable Integer expirationMedianTimestamp) { + this.expirationMedianTimestamp = expirationMedianTimestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InfoModel infoModel = (InfoModel) o; + return Objects.equals(this.height, infoModel.height) && + Objects.equals(this.txCount, infoModel.txCount) && + Objects.equals(this.txPoolSize, infoModel.txPoolSize) && + Objects.equals(this.altBlocksCount, infoModel.altBlocksCount) && + Objects.equals(this.outgoingConnectionsCount, infoModel.outgoingConnectionsCount) && + Objects.equals(this.incomingConnectionsCount, infoModel.incomingConnectionsCount) && + Objects.equals(this.synchronizedConnectionsCount, infoModel.synchronizedConnectionsCount) && + Objects.equals(this.whitePeerlistSize, infoModel.whitePeerlistSize) && + Objects.equals(this.greyPeerlistSize, infoModel.greyPeerlistSize) && + Objects.equals(this.currentBlocksMedian, infoModel.currentBlocksMedian) && + Objects.equals(this.aliasCount, infoModel.aliasCount) && + Objects.equals(this.currentMaxAllowedBlockSize, infoModel.currentMaxAllowedBlockSize) && + Objects.equals(this.daemonNetworkState, infoModel.daemonNetworkState) && + Objects.equals(this.synchronizationStartHeight, infoModel.synchronizationStartHeight) && + Objects.equals(this.maxNetSeenHeight, infoModel.maxNetSeenHeight) && + Objects.equals(this.mi, infoModel.mi) && + Objects.equals(this.posAllowed, infoModel.posAllowed) && + Objects.equals(this.posDifficulty, infoModel.posDifficulty) && + Objects.equals(this.powDifficulty, infoModel.powDifficulty) && + Objects.equals(this.defaultFee, infoModel.defaultFee) && + Objects.equals(this.minimumFee, infoModel.minimumFee) && + Objects.equals(this.isHardforkActive, infoModel.isHardforkActive) && + Objects.equals(this.netTimeDeltaMedian, infoModel.netTimeDeltaMedian) && + Objects.equals(this.currentNetworkHashrate50, infoModel.currentNetworkHashrate50) && + Objects.equals(this.currentNetworkHashrate350, infoModel.currentNetworkHashrate350) && + Objects.equals(this.secondsFor10Blocks, infoModel.secondsFor10Blocks) && + Objects.equals(this.secondsFor30Blocks, infoModel.secondsFor30Blocks) && + Objects.equals(this.transactionsCntPerDay, infoModel.transactionsCntPerDay) && + Objects.equals(this.transactionsVolumePerDay, infoModel.transactionsVolumePerDay) && + Objects.equals(this.lastPosTimestamp, infoModel.lastPosTimestamp) && + Objects.equals(this.lastPowTimestamp, infoModel.lastPowTimestamp) && + Objects.equals(this.totalCoins, infoModel.totalCoins) && + Objects.equals(this.lastBlockSize, infoModel.lastBlockSize) && + Objects.equals(this.txCountInLastBlock, infoModel.txCountInLastBlock) && + Objects.equals(this.posSequenceFactor, infoModel.posSequenceFactor) && + Objects.equals(this.powSequenceFactor, infoModel.powSequenceFactor) && + Objects.equals(this.blockReward, infoModel.blockReward) && + Objects.equals(this.lastBlockTotalReward, infoModel.lastBlockTotalReward) && + Objects.equals(this.posDiffTotalCoinsRate, infoModel.posDiffTotalCoinsRate) && + Objects.equals(this.lastBlockTimestamp, infoModel.lastBlockTimestamp) && + Objects.equals(this.lastBlockHash, infoModel.lastBlockHash) && + Objects.equals(this.posBlockTsShiftVsActual, infoModel.posBlockTsShiftVsActual) && + Objects.equals(this.outsStat, infoModel.outsStat) && + Objects.equals(this.performanceData, infoModel.performanceData) && + Objects.equals(this.offersCount, infoModel.offersCount) && + Objects.equals(this.expirationMedianTimestamp, infoModel.expirationMedianTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash(height, txCount, txPoolSize, altBlocksCount, outgoingConnectionsCount, incomingConnectionsCount, synchronizedConnectionsCount, whitePeerlistSize, greyPeerlistSize, currentBlocksMedian, aliasCount, currentMaxAllowedBlockSize, daemonNetworkState, synchronizationStartHeight, maxNetSeenHeight, mi, posAllowed, posDifficulty, powDifficulty, defaultFee, minimumFee, isHardforkActive, netTimeDeltaMedian, currentNetworkHashrate50, currentNetworkHashrate350, secondsFor10Blocks, secondsFor30Blocks, transactionsCntPerDay, transactionsVolumePerDay, lastPosTimestamp, lastPowTimestamp, totalCoins, lastBlockSize, txCountInLastBlock, posSequenceFactor, powSequenceFactor, blockReward, lastBlockTotalReward, posDiffTotalCoinsRate, lastBlockTimestamp, lastBlockHash, posBlockTsShiftVsActual, outsStat, performanceData, offersCount, expirationMedianTimestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InfoModel {\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" txCount: ").append(toIndentedString(txCount)).append("\n"); + sb.append(" txPoolSize: ").append(toIndentedString(txPoolSize)).append("\n"); + sb.append(" altBlocksCount: ").append(toIndentedString(altBlocksCount)).append("\n"); + sb.append(" outgoingConnectionsCount: ").append(toIndentedString(outgoingConnectionsCount)).append("\n"); + sb.append(" incomingConnectionsCount: ").append(toIndentedString(incomingConnectionsCount)).append("\n"); + sb.append(" synchronizedConnectionsCount: ").append(toIndentedString(synchronizedConnectionsCount)).append("\n"); + sb.append(" whitePeerlistSize: ").append(toIndentedString(whitePeerlistSize)).append("\n"); + sb.append(" greyPeerlistSize: ").append(toIndentedString(greyPeerlistSize)).append("\n"); + sb.append(" currentBlocksMedian: ").append(toIndentedString(currentBlocksMedian)).append("\n"); + sb.append(" aliasCount: ").append(toIndentedString(aliasCount)).append("\n"); + sb.append(" currentMaxAllowedBlockSize: ").append(toIndentedString(currentMaxAllowedBlockSize)).append("\n"); + sb.append(" daemonNetworkState: ").append(toIndentedString(daemonNetworkState)).append("\n"); + sb.append(" synchronizationStartHeight: ").append(toIndentedString(synchronizationStartHeight)).append("\n"); + sb.append(" maxNetSeenHeight: ").append(toIndentedString(maxNetSeenHeight)).append("\n"); + sb.append(" mi: ").append(toIndentedString(mi)).append("\n"); + sb.append(" posAllowed: ").append(toIndentedString(posAllowed)).append("\n"); + sb.append(" posDifficulty: ").append(toIndentedString(posDifficulty)).append("\n"); + sb.append(" powDifficulty: ").append(toIndentedString(powDifficulty)).append("\n"); + sb.append(" defaultFee: ").append(toIndentedString(defaultFee)).append("\n"); + sb.append(" minimumFee: ").append(toIndentedString(minimumFee)).append("\n"); + sb.append(" isHardforkActive: ").append(toIndentedString(isHardforkActive)).append("\n"); + sb.append(" netTimeDeltaMedian: ").append(toIndentedString(netTimeDeltaMedian)).append("\n"); + sb.append(" currentNetworkHashrate50: ").append(toIndentedString(currentNetworkHashrate50)).append("\n"); + sb.append(" currentNetworkHashrate350: ").append(toIndentedString(currentNetworkHashrate350)).append("\n"); + sb.append(" secondsFor10Blocks: ").append(toIndentedString(secondsFor10Blocks)).append("\n"); + sb.append(" secondsFor30Blocks: ").append(toIndentedString(secondsFor30Blocks)).append("\n"); + sb.append(" transactionsCntPerDay: ").append(toIndentedString(transactionsCntPerDay)).append("\n"); + sb.append(" transactionsVolumePerDay: ").append(toIndentedString(transactionsVolumePerDay)).append("\n"); + sb.append(" lastPosTimestamp: ").append(toIndentedString(lastPosTimestamp)).append("\n"); + sb.append(" lastPowTimestamp: ").append(toIndentedString(lastPowTimestamp)).append("\n"); + sb.append(" totalCoins: ").append(toIndentedString(totalCoins)).append("\n"); + sb.append(" lastBlockSize: ").append(toIndentedString(lastBlockSize)).append("\n"); + sb.append(" txCountInLastBlock: ").append(toIndentedString(txCountInLastBlock)).append("\n"); + sb.append(" posSequenceFactor: ").append(toIndentedString(posSequenceFactor)).append("\n"); + sb.append(" powSequenceFactor: ").append(toIndentedString(powSequenceFactor)).append("\n"); + sb.append(" blockReward: ").append(toIndentedString(blockReward)).append("\n"); + sb.append(" lastBlockTotalReward: ").append(toIndentedString(lastBlockTotalReward)).append("\n"); + sb.append(" posDiffTotalCoinsRate: ").append(toIndentedString(posDiffTotalCoinsRate)).append("\n"); + sb.append(" lastBlockTimestamp: ").append(toIndentedString(lastBlockTimestamp)).append("\n"); + sb.append(" lastBlockHash: ").append(toIndentedString(lastBlockHash)).append("\n"); + sb.append(" posBlockTsShiftVsActual: ").append(toIndentedString(posBlockTsShiftVsActual)).append("\n"); + sb.append(" outsStat: ").append(toIndentedString(outsStat)).append("\n"); + sb.append(" performanceData: ").append(toIndentedString(performanceData)).append("\n"); + sb.append(" offersCount: ").append(toIndentedString(offersCount)).append("\n"); + sb.append(" expirationMedianTimestamp: ").append(toIndentedString(expirationMedianTimestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("height", "tx_count", "tx_pool_size", "alt_blocks_count", "outgoing_connections_count", "incoming_connections_count", "synchronized_connections_count", "white_peerlist_size", "grey_peerlist_size", "current_blocks_median", "alias_count", "current_max_allowed_block_size", "daemon_network_state", "synchronization_start_height", "max_net_seen_height", "mi", "pos_allowed", "pos_difficulty", "pow_difficulty", "default_fee", "minimum_fee", "is_hardfork_active", "net_time_delta_median", "current_network_hashrate_50", "current_network_hashrate_350", "seconds_for_10_blocks", "seconds_for_30_blocks", "transactions_cnt_per_day", "transactions_volume_per_day", "last_pos_timestamp", "last_pow_timestamp", "total_coins", "last_block_size", "tx_count_in_last_block", "pos_sequence_factor", "pow_sequence_factor", "block_reward", "last_block_total_reward", "pos_diff_total_coins_rate", "last_block_timestamp", "last_block_hash", "pos_block_ts_shift_vs_actual", "outs_stat", "performance_data", "offers_count", "expiration_median_timestamp")); + + // 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 InfoModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InfoModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in InfoModel is not found in the empty JSON string", InfoModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InfoModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `InfoModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("daemon_network_state") != null && !jsonObj.get("daemon_network_state").isJsonNull()) && !jsonObj.get("daemon_network_state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `daemon_network_state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("daemon_network_state").toString())); + } + // validate the optional field `mi` + if (jsonObj.get("mi") != null && !jsonObj.get("mi").isJsonNull()) { + MaintainersInfoModel.validateJsonElement(jsonObj.get("mi")); + } + if ((jsonObj.get("pos_difficulty") != null && !jsonObj.get("pos_difficulty").isJsonNull()) && !jsonObj.get("pos_difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pos_difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pos_difficulty").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("is_hardfork_active") != null && !jsonObj.get("is_hardfork_active").isJsonNull() && !jsonObj.get("is_hardfork_active").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `is_hardfork_active` to be an array in the JSON string but got `%s`", jsonObj.get("is_hardfork_active").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transactions_cnt_per_day") != null && !jsonObj.get("transactions_cnt_per_day").isJsonNull() && !jsonObj.get("transactions_cnt_per_day").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `transactions_cnt_per_day` to be an array in the JSON string but got `%s`", jsonObj.get("transactions_cnt_per_day").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transactions_volume_per_day") != null && !jsonObj.get("transactions_volume_per_day").isJsonNull() && !jsonObj.get("transactions_volume_per_day").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `transactions_volume_per_day` to be an array in the JSON string but got `%s`", jsonObj.get("transactions_volume_per_day").toString())); + } + if ((jsonObj.get("total_coins") != null && !jsonObj.get("total_coins").isJsonNull()) && !jsonObj.get("total_coins").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `total_coins` to be a primitive type in the JSON string but got `%s`", jsonObj.get("total_coins").toString())); + } + if ((jsonObj.get("last_block_hash") != null && !jsonObj.get("last_block_hash").isJsonNull()) && !jsonObj.get("last_block_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `last_block_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_block_hash").toString())); + } + // validate the optional field `performance_data` + if (jsonObj.get("performance_data") != null && !jsonObj.get("performance_data").isJsonNull()) { + PerformanceModel.validateJsonElement(jsonObj.get("performance_data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InfoModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InfoModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InfoModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InfoModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InfoModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InfoModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of InfoModel + * @throws IOException if the JSON string is invalid with respect to InfoModel + */ + public static InfoModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InfoModel.class); + } + + /** + * Convert an instance of InfoModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/MaintainersInfoModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/MaintainersInfoModel.java new file mode 100644 index 00000000..45b5ae2d --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/MaintainersInfoModel.java @@ -0,0 +1,318 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * MaintainersInfoModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class MaintainersInfoModel { + public static final String SERIALIZED_NAME_VER_MAJOR = "ver_major"; + @SerializedName(SERIALIZED_NAME_VER_MAJOR) + @javax.annotation.Nullable + private Integer verMajor; + + public static final String SERIALIZED_NAME_VER_MINOR = "ver_minor"; + @SerializedName(SERIALIZED_NAME_VER_MINOR) + @javax.annotation.Nullable + private Integer verMinor; + + public static final String SERIALIZED_NAME_VER_REVISION = "ver_revision"; + @SerializedName(SERIALIZED_NAME_VER_REVISION) + @javax.annotation.Nullable + private Integer verRevision; + + public static final String SERIALIZED_NAME_BUILD_NO = "build_no"; + @SerializedName(SERIALIZED_NAME_BUILD_NO) + @javax.annotation.Nullable + private Integer buildNo; + + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + @javax.annotation.Nullable + private Integer mode; + + public MaintainersInfoModel() { + } + + public MaintainersInfoModel verMajor(@javax.annotation.Nullable Integer verMajor) { + this.verMajor = verMajor; + return this; + } + + /** + * Get verMajor + * minimum: 0 + * maximum: 255 + * @return verMajor + */ + @javax.annotation.Nullable + public Integer getVerMajor() { + return verMajor; + } + + public void setVerMajor(@javax.annotation.Nullable Integer verMajor) { + this.verMajor = verMajor; + } + + + public MaintainersInfoModel verMinor(@javax.annotation.Nullable Integer verMinor) { + this.verMinor = verMinor; + return this; + } + + /** + * Get verMinor + * minimum: 0 + * maximum: 255 + * @return verMinor + */ + @javax.annotation.Nullable + public Integer getVerMinor() { + return verMinor; + } + + public void setVerMinor(@javax.annotation.Nullable Integer verMinor) { + this.verMinor = verMinor; + } + + + public MaintainersInfoModel verRevision(@javax.annotation.Nullable Integer verRevision) { + this.verRevision = verRevision; + return this; + } + + /** + * Get verRevision + * minimum: 0 + * maximum: 255 + * @return verRevision + */ + @javax.annotation.Nullable + public Integer getVerRevision() { + return verRevision; + } + + public void setVerRevision(@javax.annotation.Nullable Integer verRevision) { + this.verRevision = verRevision; + } + + + public MaintainersInfoModel buildNo(@javax.annotation.Nullable Integer buildNo) { + this.buildNo = buildNo; + return this; + } + + /** + * Get buildNo + * minimum: 0 + * maximum: 4294967295 + * @return buildNo + */ + @javax.annotation.Nullable + public Integer getBuildNo() { + return buildNo; + } + + public void setBuildNo(@javax.annotation.Nullable Integer buildNo) { + this.buildNo = buildNo; + } + + + public MaintainersInfoModel mode(@javax.annotation.Nullable Integer mode) { + this.mode = mode; + return this; + } + + /** + * Get mode + * minimum: 0 + * maximum: 255 + * @return mode + */ + @javax.annotation.Nullable + public Integer getMode() { + return mode; + } + + public void setMode(@javax.annotation.Nullable Integer mode) { + this.mode = mode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintainersInfoModel maintainersInfoModel = (MaintainersInfoModel) o; + return Objects.equals(this.verMajor, maintainersInfoModel.verMajor) && + Objects.equals(this.verMinor, maintainersInfoModel.verMinor) && + Objects.equals(this.verRevision, maintainersInfoModel.verRevision) && + Objects.equals(this.buildNo, maintainersInfoModel.buildNo) && + Objects.equals(this.mode, maintainersInfoModel.mode); + } + + @Override + public int hashCode() { + return Objects.hash(verMajor, verMinor, verRevision, buildNo, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintainersInfoModel {\n"); + sb.append(" verMajor: ").append(toIndentedString(verMajor)).append("\n"); + sb.append(" verMinor: ").append(toIndentedString(verMinor)).append("\n"); + sb.append(" verRevision: ").append(toIndentedString(verRevision)).append("\n"); + sb.append(" buildNo: ").append(toIndentedString(buildNo)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("ver_major", "ver_minor", "ver_revision", "build_no", "mode")); + + // 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 MaintainersInfoModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaintainersInfoModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in MaintainersInfoModel is not found in the empty JSON string", MaintainersInfoModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaintainersInfoModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `MaintainersInfoModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MaintainersInfoModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MaintainersInfoModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MaintainersInfoModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MaintainersInfoModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MaintainersInfoModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MaintainersInfoModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaintainersInfoModel + * @throws IOException if the JSON string is invalid with respect to MaintainersInfoModel + */ + public static MaintainersInfoModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MaintainersInfoModel.class); + } + + /** + * Convert an instance of MaintainersInfoModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/PerformanceModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/PerformanceModel.java new file mode 100644 index 00000000..8e65e0be --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/PerformanceModel.java @@ -0,0 +1,302 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.client.model.BlockProcessingPerformanceModel; +import org.openapitools.client.model.DbStatInfoModel; +import org.openapitools.client.model.TxPoolPerformanceModel; +import org.openapitools.client.model.TxProcessingPerformanceModel; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * PerformanceModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class PerformanceModel { + public static final String SERIALIZED_NAME_BLOCK_PROCESSING = "block_processing"; + @SerializedName(SERIALIZED_NAME_BLOCK_PROCESSING) + @javax.annotation.Nullable + private BlockProcessingPerformanceModel blockProcessing; + + public static final String SERIALIZED_NAME_TX_PROCESSING = "tx_processing"; + @SerializedName(SERIALIZED_NAME_TX_PROCESSING) + @javax.annotation.Nullable + private TxProcessingPerformanceModel txProcessing; + + public static final String SERIALIZED_NAME_TX_POOL = "tx_pool"; + @SerializedName(SERIALIZED_NAME_TX_POOL) + @javax.annotation.Nullable + private TxPoolPerformanceModel txPool; + + public static final String SERIALIZED_NAME_DB_STAT_INFO = "db_stat_info"; + @SerializedName(SERIALIZED_NAME_DB_STAT_INFO) + @javax.annotation.Nullable + private DbStatInfoModel dbStatInfo; + + public PerformanceModel() { + } + + public PerformanceModel blockProcessing(@javax.annotation.Nullable BlockProcessingPerformanceModel blockProcessing) { + this.blockProcessing = blockProcessing; + return this; + } + + /** + * Get blockProcessing + * @return blockProcessing + */ + @javax.annotation.Nullable + public BlockProcessingPerformanceModel getBlockProcessing() { + return blockProcessing; + } + + public void setBlockProcessing(@javax.annotation.Nullable BlockProcessingPerformanceModel blockProcessing) { + this.blockProcessing = blockProcessing; + } + + + public PerformanceModel txProcessing(@javax.annotation.Nullable TxProcessingPerformanceModel txProcessing) { + this.txProcessing = txProcessing; + return this; + } + + /** + * Get txProcessing + * @return txProcessing + */ + @javax.annotation.Nullable + public TxProcessingPerformanceModel getTxProcessing() { + return txProcessing; + } + + public void setTxProcessing(@javax.annotation.Nullable TxProcessingPerformanceModel txProcessing) { + this.txProcessing = txProcessing; + } + + + public PerformanceModel txPool(@javax.annotation.Nullable TxPoolPerformanceModel txPool) { + this.txPool = txPool; + return this; + } + + /** + * Get txPool + * @return txPool + */ + @javax.annotation.Nullable + public TxPoolPerformanceModel getTxPool() { + return txPool; + } + + public void setTxPool(@javax.annotation.Nullable TxPoolPerformanceModel txPool) { + this.txPool = txPool; + } + + + public PerformanceModel dbStatInfo(@javax.annotation.Nullable DbStatInfoModel dbStatInfo) { + this.dbStatInfo = dbStatInfo; + return this; + } + + /** + * Get dbStatInfo + * @return dbStatInfo + */ + @javax.annotation.Nullable + public DbStatInfoModel getDbStatInfo() { + return dbStatInfo; + } + + public void setDbStatInfo(@javax.annotation.Nullable DbStatInfoModel dbStatInfo) { + this.dbStatInfo = dbStatInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformanceModel performanceModel = (PerformanceModel) o; + return Objects.equals(this.blockProcessing, performanceModel.blockProcessing) && + Objects.equals(this.txProcessing, performanceModel.txProcessing) && + Objects.equals(this.txPool, performanceModel.txPool) && + Objects.equals(this.dbStatInfo, performanceModel.dbStatInfo); + } + + @Override + public int hashCode() { + return Objects.hash(blockProcessing, txProcessing, txPool, dbStatInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PerformanceModel {\n"); + sb.append(" blockProcessing: ").append(toIndentedString(blockProcessing)).append("\n"); + sb.append(" txProcessing: ").append(toIndentedString(txProcessing)).append("\n"); + sb.append(" txPool: ").append(toIndentedString(txPool)).append("\n"); + sb.append(" dbStatInfo: ").append(toIndentedString(dbStatInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("block_processing", "tx_processing", "tx_pool", "db_stat_info")); + + // 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 PerformanceModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PerformanceModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in PerformanceModel is not found in the empty JSON string", PerformanceModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PerformanceModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PerformanceModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `block_processing` + if (jsonObj.get("block_processing") != null && !jsonObj.get("block_processing").isJsonNull()) { + BlockProcessingPerformanceModel.validateJsonElement(jsonObj.get("block_processing")); + } + // validate the optional field `tx_processing` + if (jsonObj.get("tx_processing") != null && !jsonObj.get("tx_processing").isJsonNull()) { + TxProcessingPerformanceModel.validateJsonElement(jsonObj.get("tx_processing")); + } + // validate the optional field `tx_pool` + if (jsonObj.get("tx_pool") != null && !jsonObj.get("tx_pool").isJsonNull()) { + TxPoolPerformanceModel.validateJsonElement(jsonObj.get("tx_pool")); + } + // validate the optional field `db_stat_info` + if (jsonObj.get("db_stat_info") != null && !jsonObj.get("db_stat_info").isJsonNull()) { + DbStatInfoModel.validateJsonElement(jsonObj.get("db_stat_info")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PerformanceModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PerformanceModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PerformanceModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PerformanceModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PerformanceModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PerformanceModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PerformanceModel + * @throws IOException if the JSON string is invalid with respect to PerformanceModel + */ + public static PerformanceModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PerformanceModel.class); + } + + /** + * Convert an instance of PerformanceModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/PosEntryModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/PosEntryModel.java new file mode 100644 index 00000000..bf1bcbb6 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/PosEntryModel.java @@ -0,0 +1,392 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * PosEntryModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class PosEntryModel { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + @javax.annotation.Nullable + private Integer amount; + + public static final String SERIALIZED_NAME_G_INDEX = "g_index"; + @SerializedName(SERIALIZED_NAME_G_INDEX) + @javax.annotation.Nullable + private Integer gIndex; + + public static final String SERIALIZED_NAME_KEYIMAGE = "keyimage"; + @SerializedName(SERIALIZED_NAME_KEYIMAGE) + @javax.annotation.Nullable + private String keyimage; + + public static final String SERIALIZED_NAME_BLOCK_TIMESTAMP = "block_timestamp"; + @SerializedName(SERIALIZED_NAME_BLOCK_TIMESTAMP) + @javax.annotation.Nullable + private Integer blockTimestamp; + + public static final String SERIALIZED_NAME_STAKE_UNLOCK_TIME = "stake_unlock_time"; + @SerializedName(SERIALIZED_NAME_STAKE_UNLOCK_TIME) + @javax.annotation.Nullable + private Integer stakeUnlockTime; + + public static final String SERIALIZED_NAME_TX_ID = "tx_id"; + @SerializedName(SERIALIZED_NAME_TX_ID) + @javax.annotation.Nullable + private String txId; + + public static final String SERIALIZED_NAME_TX_OUT_INDEX = "tx_out_index"; + @SerializedName(SERIALIZED_NAME_TX_OUT_INDEX) + @javax.annotation.Nullable + private Integer txOutIndex; + + public static final String SERIALIZED_NAME_WALLET_INDEX = "wallet_index"; + @SerializedName(SERIALIZED_NAME_WALLET_INDEX) + @javax.annotation.Nullable + private Integer walletIndex; + + public PosEntryModel() { + } + + public PosEntryModel amount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + */ + @javax.annotation.Nullable + public Integer getAmount() { + return amount; + } + + public void setAmount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + } + + + public PosEntryModel gIndex(@javax.annotation.Nullable Integer gIndex) { + this.gIndex = gIndex; + return this; + } + + /** + * Get gIndex + * @return gIndex + */ + @javax.annotation.Nullable + public Integer getgIndex() { + return gIndex; + } + + public void setgIndex(@javax.annotation.Nullable Integer gIndex) { + this.gIndex = gIndex; + } + + + public PosEntryModel keyimage(@javax.annotation.Nullable String keyimage) { + this.keyimage = keyimage; + return this; + } + + /** + * Get keyimage + * @return keyimage + */ + @javax.annotation.Nullable + public String getKeyimage() { + return keyimage; + } + + public void setKeyimage(@javax.annotation.Nullable String keyimage) { + this.keyimage = keyimage; + } + + + public PosEntryModel blockTimestamp(@javax.annotation.Nullable Integer blockTimestamp) { + this.blockTimestamp = blockTimestamp; + return this; + } + + /** + * Get blockTimestamp + * @return blockTimestamp + */ + @javax.annotation.Nullable + public Integer getBlockTimestamp() { + return blockTimestamp; + } + + public void setBlockTimestamp(@javax.annotation.Nullable Integer blockTimestamp) { + this.blockTimestamp = blockTimestamp; + } + + + public PosEntryModel stakeUnlockTime(@javax.annotation.Nullable Integer stakeUnlockTime) { + this.stakeUnlockTime = stakeUnlockTime; + return this; + } + + /** + * Get stakeUnlockTime + * @return stakeUnlockTime + */ + @javax.annotation.Nullable + public Integer getStakeUnlockTime() { + return stakeUnlockTime; + } + + public void setStakeUnlockTime(@javax.annotation.Nullable Integer stakeUnlockTime) { + this.stakeUnlockTime = stakeUnlockTime; + } + + + public PosEntryModel txId(@javax.annotation.Nullable String txId) { + this.txId = txId; + return this; + } + + /** + * Get txId + * @return txId + */ + @javax.annotation.Nullable + public String getTxId() { + return txId; + } + + public void setTxId(@javax.annotation.Nullable String txId) { + this.txId = txId; + } + + + public PosEntryModel txOutIndex(@javax.annotation.Nullable Integer txOutIndex) { + this.txOutIndex = txOutIndex; + return this; + } + + /** + * Get txOutIndex + * @return txOutIndex + */ + @javax.annotation.Nullable + public Integer getTxOutIndex() { + return txOutIndex; + } + + public void setTxOutIndex(@javax.annotation.Nullable Integer txOutIndex) { + this.txOutIndex = txOutIndex; + } + + + public PosEntryModel walletIndex(@javax.annotation.Nullable Integer walletIndex) { + this.walletIndex = walletIndex; + return this; + } + + /** + * Get walletIndex + * @return walletIndex + */ + @javax.annotation.Nullable + public Integer getWalletIndex() { + return walletIndex; + } + + public void setWalletIndex(@javax.annotation.Nullable Integer walletIndex) { + this.walletIndex = walletIndex; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PosEntryModel posEntryModel = (PosEntryModel) o; + return Objects.equals(this.amount, posEntryModel.amount) && + Objects.equals(this.gIndex, posEntryModel.gIndex) && + Objects.equals(this.keyimage, posEntryModel.keyimage) && + Objects.equals(this.blockTimestamp, posEntryModel.blockTimestamp) && + Objects.equals(this.stakeUnlockTime, posEntryModel.stakeUnlockTime) && + Objects.equals(this.txId, posEntryModel.txId) && + Objects.equals(this.txOutIndex, posEntryModel.txOutIndex) && + Objects.equals(this.walletIndex, posEntryModel.walletIndex); + } + + @Override + public int hashCode() { + return Objects.hash(amount, gIndex, keyimage, blockTimestamp, stakeUnlockTime, txId, txOutIndex, walletIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PosEntryModel {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" gIndex: ").append(toIndentedString(gIndex)).append("\n"); + sb.append(" keyimage: ").append(toIndentedString(keyimage)).append("\n"); + sb.append(" blockTimestamp: ").append(toIndentedString(blockTimestamp)).append("\n"); + sb.append(" stakeUnlockTime: ").append(toIndentedString(stakeUnlockTime)).append("\n"); + sb.append(" txId: ").append(toIndentedString(txId)).append("\n"); + sb.append(" txOutIndex: ").append(toIndentedString(txOutIndex)).append("\n"); + sb.append(" walletIndex: ").append(toIndentedString(walletIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("amount", "g_index", "keyimage", "block_timestamp", "stake_unlock_time", "tx_id", "tx_out_index", "wallet_index")); + + // 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 PosEntryModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PosEntryModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in PosEntryModel is not found in the empty JSON string", PosEntryModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PosEntryModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PosEntryModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("keyimage") != null && !jsonObj.get("keyimage").isJsonNull()) && !jsonObj.get("keyimage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `keyimage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyimage").toString())); + } + if ((jsonObj.get("tx_id") != null && !jsonObj.get("tx_id").isJsonNull()) && !jsonObj.get("tx_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tx_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tx_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PosEntryModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PosEntryModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PosEntryModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PosEntryModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PosEntryModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PosEntryModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PosEntryModel + * @throws IOException if the JSON string is invalid with respect to PosEntryModel + */ + public static PosEntryModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PosEntryModel.class); + } + + /** + * Convert an instance of PosEntryModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockRequestModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockRequestModel.java new file mode 100644 index 00000000..d9c444fc --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockRequestModel.java @@ -0,0 +1,207 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * SubmitBlockRequestModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class SubmitBlockRequestModel { + public static final String SERIALIZED_NAME_BLOCK_BLOB = "block_blob"; + @SerializedName(SERIALIZED_NAME_BLOCK_BLOB) + @javax.annotation.Nullable + private String blockBlob; + + public SubmitBlockRequestModel() { + } + + public SubmitBlockRequestModel blockBlob(@javax.annotation.Nullable String blockBlob) { + this.blockBlob = blockBlob; + return this; + } + + /** + * Get blockBlob + * @return blockBlob + */ + @javax.annotation.Nullable + public String getBlockBlob() { + return blockBlob; + } + + public void setBlockBlob(@javax.annotation.Nullable String blockBlob) { + this.blockBlob = blockBlob; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubmitBlockRequestModel submitBlockRequestModel = (SubmitBlockRequestModel) o; + return Objects.equals(this.blockBlob, submitBlockRequestModel.blockBlob); + } + + @Override + public int hashCode() { + return Objects.hash(blockBlob); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubmitBlockRequestModel {\n"); + sb.append(" blockBlob: ").append(toIndentedString(blockBlob)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("block_blob")); + + // 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 SubmitBlockRequestModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubmitBlockRequestModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SubmitBlockRequestModel is not found in the empty JSON string", SubmitBlockRequestModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SubmitBlockRequestModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `SubmitBlockRequestModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("block_blob") != null && !jsonObj.get("block_blob").isJsonNull()) && !jsonObj.get("block_blob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `block_blob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("block_blob").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubmitBlockRequestModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitBlockRequestModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubmitBlockRequestModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubmitBlockRequestModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubmitBlockRequestModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubmitBlockRequestModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitBlockRequestModel + * @throws IOException if the JSON string is invalid with respect to SubmitBlockRequestModel + */ + public static SubmitBlockRequestModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubmitBlockRequestModel.class); + } + + /** + * Convert an instance of SubmitBlockRequestModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockResponseModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockResponseModel.java new file mode 100644 index 00000000..be5932a9 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/SubmitBlockResponseModel.java @@ -0,0 +1,207 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * SubmitBlockResponseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class SubmitBlockResponseModel { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable + private String status; + + public SubmitBlockResponseModel() { + } + + public SubmitBlockResponseModel status(@javax.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nullable String status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubmitBlockResponseModel submitBlockResponseModel = (SubmitBlockResponseModel) o; + return Objects.equals(this.status, submitBlockResponseModel.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubmitBlockResponseModel {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("status")); + + // 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 SubmitBlockResponseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubmitBlockResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SubmitBlockResponseModel is not found in the empty JSON string", SubmitBlockResponseModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SubmitBlockResponseModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `SubmitBlockResponseModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubmitBlockResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitBlockResponseModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubmitBlockResponseModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubmitBlockResponseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubmitBlockResponseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubmitBlockResponseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitBlockResponseModel + * @throws IOException if the JSON string is invalid with respect to SubmitBlockResponseModel + */ + public static SubmitBlockResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubmitBlockResponseModel.class); + } + + /** + * Convert an instance of SubmitBlockResponseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionAttachmentModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionAttachmentModel.java new file mode 100644 index 00000000..eb906500 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionAttachmentModel.java @@ -0,0 +1,265 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TransactionAttachmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TransactionAttachmentModel { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SHORT_VIEW = "short_view"; + @SerializedName(SERIALIZED_NAME_SHORT_VIEW) + @javax.annotation.Nullable + private String shortView; + + public static final String SERIALIZED_NAME_DETAILS_VIEW = "details_view"; + @SerializedName(SERIALIZED_NAME_DETAILS_VIEW) + @javax.annotation.Nullable + private String detailsView; + + public TransactionAttachmentModel() { + } + + public TransactionAttachmentModel type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public TransactionAttachmentModel shortView(@javax.annotation.Nullable String shortView) { + this.shortView = shortView; + return this; + } + + /** + * Get shortView + * @return shortView + */ + @javax.annotation.Nullable + public String getShortView() { + return shortView; + } + + public void setShortView(@javax.annotation.Nullable String shortView) { + this.shortView = shortView; + } + + + public TransactionAttachmentModel detailsView(@javax.annotation.Nullable String detailsView) { + this.detailsView = detailsView; + return this; + } + + /** + * Get detailsView + * @return detailsView + */ + @javax.annotation.Nullable + public String getDetailsView() { + return detailsView; + } + + public void setDetailsView(@javax.annotation.Nullable String detailsView) { + this.detailsView = detailsView; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionAttachmentModel transactionAttachmentModel = (TransactionAttachmentModel) o; + return Objects.equals(this.type, transactionAttachmentModel.type) && + Objects.equals(this.shortView, transactionAttachmentModel.shortView) && + Objects.equals(this.detailsView, transactionAttachmentModel.detailsView); + } + + @Override + public int hashCode() { + return Objects.hash(type, shortView, detailsView); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionAttachmentModel {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" shortView: ").append(toIndentedString(shortView)).append("\n"); + sb.append(" detailsView: ").append(toIndentedString(detailsView)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("type", "short_view", "details_view")); + + // 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 TransactionAttachmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TransactionAttachmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TransactionAttachmentModel is not found in the empty JSON string", TransactionAttachmentModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TransactionAttachmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TransactionAttachmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("short_view") != null && !jsonObj.get("short_view").isJsonNull()) && !jsonObj.get("short_view").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `short_view` to be a primitive type in the JSON string but got `%s`", jsonObj.get("short_view").toString())); + } + if ((jsonObj.get("details_view") != null && !jsonObj.get("details_view").isJsonNull()) && !jsonObj.get("details_view").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `details_view` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details_view").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionAttachmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionAttachmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionAttachmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionAttachmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionAttachmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionAttachmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionAttachmentModel + * @throws IOException if the JSON string is invalid with respect to TransactionAttachmentModel + */ + public static TransactionAttachmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionAttachmentModel.class); + } + + /** + * Convert an instance of TransactionAttachmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionDetailsModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionDetailsModel.java new file mode 100644 index 00000000..af3bcc05 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionDetailsModel.java @@ -0,0 +1,622 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.TransactionAttachmentModel; +import org.openapitools.client.model.TransactionExtraModel; +import org.openapitools.client.model.TransactionInputModel; +import org.openapitools.client.model.TransactionOutputModel; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TransactionDetailsModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TransactionDetailsModel { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + @javax.annotation.Nullable + private Integer amount; + + public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments"; + @SerializedName(SERIALIZED_NAME_ATTACHMENTS) + @javax.annotation.Nullable + private List attachments = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BLOB = "blob"; + @SerializedName(SERIALIZED_NAME_BLOB) + @javax.annotation.Nullable + private String blob; + + public static final String SERIALIZED_NAME_BLOB_SIZE = "blob_size"; + @SerializedName(SERIALIZED_NAME_BLOB_SIZE) + @javax.annotation.Nullable + private Integer blobSize; + + public static final String SERIALIZED_NAME_EXTRA = "extra"; + @SerializedName(SERIALIZED_NAME_EXTRA) + @javax.annotation.Nullable + private List extra = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + @javax.annotation.Nullable + private Integer fee; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_INS = "ins"; + @SerializedName(SERIALIZED_NAME_INS) + @javax.annotation.Nullable + private List ins = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEEPER_BLOCK = "keeper_block"; + @SerializedName(SERIALIZED_NAME_KEEPER_BLOCK) + @javax.annotation.Nullable + private Long keeperBlock; + + public static final String SERIALIZED_NAME_OBJECT_IN_JSON = "object_in_json"; + @SerializedName(SERIALIZED_NAME_OBJECT_IN_JSON) + @javax.annotation.Nullable + private String objectInJson; + + public static final String SERIALIZED_NAME_OUTS = "outs"; + @SerializedName(SERIALIZED_NAME_OUTS) + @javax.annotation.Nullable + private List outs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUB_KEY = "pub_key"; + @SerializedName(SERIALIZED_NAME_PUB_KEY) + @javax.annotation.Nullable + private String pubKey; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @javax.annotation.Nullable + private Integer timestamp; + + public TransactionDetailsModel() { + } + + public TransactionDetailsModel amount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + */ + @javax.annotation.Nullable + public Integer getAmount() { + return amount; + } + + public void setAmount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + } + + + public TransactionDetailsModel attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public TransactionDetailsModel addAttachmentsItem(TransactionAttachmentModel attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * Get attachments + * @return attachments + */ + @javax.annotation.Nullable + public List getAttachments() { + return attachments; + } + + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public TransactionDetailsModel blob(@javax.annotation.Nullable String blob) { + this.blob = blob; + return this; + } + + /** + * Get blob + * @return blob + */ + @javax.annotation.Nullable + public String getBlob() { + return blob; + } + + public void setBlob(@javax.annotation.Nullable String blob) { + this.blob = blob; + } + + + public TransactionDetailsModel blobSize(@javax.annotation.Nullable Integer blobSize) { + this.blobSize = blobSize; + return this; + } + + /** + * Get blobSize + * @return blobSize + */ + @javax.annotation.Nullable + public Integer getBlobSize() { + return blobSize; + } + + public void setBlobSize(@javax.annotation.Nullable Integer blobSize) { + this.blobSize = blobSize; + } + + + public TransactionDetailsModel extra(@javax.annotation.Nullable List extra) { + this.extra = extra; + return this; + } + + public TransactionDetailsModel addExtraItem(TransactionExtraModel extraItem) { + if (this.extra == null) { + this.extra = new ArrayList<>(); + } + this.extra.add(extraItem); + return this; + } + + /** + * Get extra + * @return extra + */ + @javax.annotation.Nullable + public List getExtra() { + return extra; + } + + public void setExtra(@javax.annotation.Nullable List extra) { + this.extra = extra; + } + + + public TransactionDetailsModel fee(@javax.annotation.Nullable Integer fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * @return fee + */ + @javax.annotation.Nullable + public Integer getFee() { + return fee; + } + + public void setFee(@javax.annotation.Nullable Integer fee) { + this.fee = fee; + } + + + public TransactionDetailsModel id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public TransactionDetailsModel ins(@javax.annotation.Nullable List ins) { + this.ins = ins; + return this; + } + + public TransactionDetailsModel addInsItem(TransactionInputModel insItem) { + if (this.ins == null) { + this.ins = new ArrayList<>(); + } + this.ins.add(insItem); + return this; + } + + /** + * Get ins + * @return ins + */ + @javax.annotation.Nullable + public List getIns() { + return ins; + } + + public void setIns(@javax.annotation.Nullable List ins) { + this.ins = ins; + } + + + public TransactionDetailsModel keeperBlock(@javax.annotation.Nullable Long keeperBlock) { + this.keeperBlock = keeperBlock; + return this; + } + + /** + * Get keeperBlock + * @return keeperBlock + */ + @javax.annotation.Nullable + public Long getKeeperBlock() { + return keeperBlock; + } + + public void setKeeperBlock(@javax.annotation.Nullable Long keeperBlock) { + this.keeperBlock = keeperBlock; + } + + + public TransactionDetailsModel objectInJson(@javax.annotation.Nullable String objectInJson) { + this.objectInJson = objectInJson; + return this; + } + + /** + * Get objectInJson + * @return objectInJson + */ + @javax.annotation.Nullable + public String getObjectInJson() { + return objectInJson; + } + + public void setObjectInJson(@javax.annotation.Nullable String objectInJson) { + this.objectInJson = objectInJson; + } + + + public TransactionDetailsModel outs(@javax.annotation.Nullable List outs) { + this.outs = outs; + return this; + } + + public TransactionDetailsModel addOutsItem(TransactionOutputModel outsItem) { + if (this.outs == null) { + this.outs = new ArrayList<>(); + } + this.outs.add(outsItem); + return this; + } + + /** + * Get outs + * @return outs + */ + @javax.annotation.Nullable + public List getOuts() { + return outs; + } + + public void setOuts(@javax.annotation.Nullable List outs) { + this.outs = outs; + } + + + public TransactionDetailsModel pubKey(@javax.annotation.Nullable String pubKey) { + this.pubKey = pubKey; + return this; + } + + /** + * Get pubKey + * @return pubKey + */ + @javax.annotation.Nullable + public String getPubKey() { + return pubKey; + } + + public void setPubKey(@javax.annotation.Nullable String pubKey) { + this.pubKey = pubKey; + } + + + public TransactionDetailsModel timestamp(@javax.annotation.Nullable Integer timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + */ + @javax.annotation.Nullable + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(@javax.annotation.Nullable Integer timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionDetailsModel transactionDetailsModel = (TransactionDetailsModel) o; + return Objects.equals(this.amount, transactionDetailsModel.amount) && + Objects.equals(this.attachments, transactionDetailsModel.attachments) && + Objects.equals(this.blob, transactionDetailsModel.blob) && + Objects.equals(this.blobSize, transactionDetailsModel.blobSize) && + Objects.equals(this.extra, transactionDetailsModel.extra) && + Objects.equals(this.fee, transactionDetailsModel.fee) && + Objects.equals(this.id, transactionDetailsModel.id) && + Objects.equals(this.ins, transactionDetailsModel.ins) && + Objects.equals(this.keeperBlock, transactionDetailsModel.keeperBlock) && + Objects.equals(this.objectInJson, transactionDetailsModel.objectInJson) && + Objects.equals(this.outs, transactionDetailsModel.outs) && + Objects.equals(this.pubKey, transactionDetailsModel.pubKey) && + Objects.equals(this.timestamp, transactionDetailsModel.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(amount, attachments, blob, blobSize, extra, fee, id, ins, keeperBlock, objectInJson, outs, pubKey, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionDetailsModel {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" blob: ").append(toIndentedString(blob)).append("\n"); + sb.append(" blobSize: ").append(toIndentedString(blobSize)).append("\n"); + sb.append(" extra: ").append(toIndentedString(extra)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ins: ").append(toIndentedString(ins)).append("\n"); + sb.append(" keeperBlock: ").append(toIndentedString(keeperBlock)).append("\n"); + sb.append(" objectInJson: ").append(toIndentedString(objectInJson)).append("\n"); + sb.append(" outs: ").append(toIndentedString(outs)).append("\n"); + sb.append(" pubKey: ").append(toIndentedString(pubKey)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("amount", "attachments", "blob", "blob_size", "extra", "fee", "id", "ins", "keeper_block", "object_in_json", "outs", "pub_key", "timestamp")); + + // 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 TransactionDetailsModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TransactionDetailsModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TransactionDetailsModel is not found in the empty JSON string", TransactionDetailsModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TransactionDetailsModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TransactionDetailsModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonNull()) { + JsonArray jsonArrayattachments = jsonObj.getAsJsonArray("attachments"); + if (jsonArrayattachments != null) { + // ensure the json data is an array + if (!jsonObj.get("attachments").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString())); + } + + // validate the optional field `attachments` (array) + for (int i = 0; i < jsonArrayattachments.size(); i++) { + TransactionAttachmentModel.validateJsonElement(jsonArrayattachments.get(i)); + }; + } + } + if ((jsonObj.get("blob") != null && !jsonObj.get("blob").isJsonNull()) && !jsonObj.get("blob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `blob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blob").toString())); + } + if (jsonObj.get("extra") != null && !jsonObj.get("extra").isJsonNull()) { + JsonArray jsonArrayextra = jsonObj.getAsJsonArray("extra"); + if (jsonArrayextra != null) { + // ensure the json data is an array + if (!jsonObj.get("extra").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `extra` to be an array in the JSON string but got `%s`", jsonObj.get("extra").toString())); + } + + // validate the optional field `extra` (array) + for (int i = 0; i < jsonArrayextra.size(); i++) { + TransactionExtraModel.validateJsonElement(jsonArrayextra.get(i)); + }; + } + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (jsonObj.get("ins") != null && !jsonObj.get("ins").isJsonNull()) { + JsonArray jsonArrayins = jsonObj.getAsJsonArray("ins"); + if (jsonArrayins != null) { + // ensure the json data is an array + if (!jsonObj.get("ins").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ins` to be an array in the JSON string but got `%s`", jsonObj.get("ins").toString())); + } + + // validate the optional field `ins` (array) + for (int i = 0; i < jsonArrayins.size(); i++) { + TransactionInputModel.validateJsonElement(jsonArrayins.get(i)); + }; + } + } + if ((jsonObj.get("object_in_json") != null && !jsonObj.get("object_in_json").isJsonNull()) && !jsonObj.get("object_in_json").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `object_in_json` to be a primitive type in the JSON string but got `%s`", jsonObj.get("object_in_json").toString())); + } + if (jsonObj.get("outs") != null && !jsonObj.get("outs").isJsonNull()) { + JsonArray jsonArrayouts = jsonObj.getAsJsonArray("outs"); + if (jsonArrayouts != null) { + // ensure the json data is an array + if (!jsonObj.get("outs").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `outs` to be an array in the JSON string but got `%s`", jsonObj.get("outs").toString())); + } + + // validate the optional field `outs` (array) + for (int i = 0; i < jsonArrayouts.size(); i++) { + TransactionOutputModel.validateJsonElement(jsonArrayouts.get(i)); + }; + } + } + if ((jsonObj.get("pub_key") != null && !jsonObj.get("pub_key").isJsonNull()) && !jsonObj.get("pub_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pub_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pub_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionDetailsModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionDetailsModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionDetailsModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionDetailsModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionDetailsModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionDetailsModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionDetailsModel + * @throws IOException if the JSON string is invalid with respect to TransactionDetailsModel + */ + public static TransactionDetailsModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionDetailsModel.class); + } + + /** + * Convert an instance of TransactionDetailsModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionExtraModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionExtraModel.java new file mode 100644 index 00000000..51ca0d24 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionExtraModel.java @@ -0,0 +1,265 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TransactionExtraModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TransactionExtraModel { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_SHORT_VIEW = "short_view"; + @SerializedName(SERIALIZED_NAME_SHORT_VIEW) + @javax.annotation.Nullable + private String shortView; + + public static final String SERIALIZED_NAME_DETAILS_VIEW = "details_view"; + @SerializedName(SERIALIZED_NAME_DETAILS_VIEW) + @javax.annotation.Nullable + private String detailsView; + + public TransactionExtraModel() { + } + + public TransactionExtraModel type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public TransactionExtraModel shortView(@javax.annotation.Nullable String shortView) { + this.shortView = shortView; + return this; + } + + /** + * Get shortView + * @return shortView + */ + @javax.annotation.Nullable + public String getShortView() { + return shortView; + } + + public void setShortView(@javax.annotation.Nullable String shortView) { + this.shortView = shortView; + } + + + public TransactionExtraModel detailsView(@javax.annotation.Nullable String detailsView) { + this.detailsView = detailsView; + return this; + } + + /** + * Get detailsView + * @return detailsView + */ + @javax.annotation.Nullable + public String getDetailsView() { + return detailsView; + } + + public void setDetailsView(@javax.annotation.Nullable String detailsView) { + this.detailsView = detailsView; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionExtraModel transactionExtraModel = (TransactionExtraModel) o; + return Objects.equals(this.type, transactionExtraModel.type) && + Objects.equals(this.shortView, transactionExtraModel.shortView) && + Objects.equals(this.detailsView, transactionExtraModel.detailsView); + } + + @Override + public int hashCode() { + return Objects.hash(type, shortView, detailsView); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionExtraModel {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" shortView: ").append(toIndentedString(shortView)).append("\n"); + sb.append(" detailsView: ").append(toIndentedString(detailsView)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("type", "short_view", "details_view")); + + // 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 TransactionExtraModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TransactionExtraModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TransactionExtraModel is not found in the empty JSON string", TransactionExtraModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TransactionExtraModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TransactionExtraModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("short_view") != null && !jsonObj.get("short_view").isJsonNull()) && !jsonObj.get("short_view").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `short_view` to be a primitive type in the JSON string but got `%s`", jsonObj.get("short_view").toString())); + } + if ((jsonObj.get("details_view") != null && !jsonObj.get("details_view").isJsonNull()) && !jsonObj.get("details_view").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `details_view` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details_view").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionExtraModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionExtraModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionExtraModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionExtraModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionExtraModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionExtraModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionExtraModel + * @throws IOException if the JSON string is invalid with respect to TransactionExtraModel + */ + public static TransactionExtraModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionExtraModel.class); + } + + /** + * Convert an instance of TransactionExtraModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionInputModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionInputModel.java new file mode 100644 index 00000000..d13949c6 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionInputModel.java @@ -0,0 +1,330 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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 java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TransactionInputModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TransactionInputModel { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + @javax.annotation.Nullable + private Integer amount; + + public static final String SERIALIZED_NAME_GLOBAL_INDEXES = "global_indexes"; + @SerializedName(SERIALIZED_NAME_GLOBAL_INDEXES) + @javax.annotation.Nullable + private List globalIndexes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_HTLC_ORIGIN = "htlc_origin"; + @SerializedName(SERIALIZED_NAME_HTLC_ORIGIN) + @javax.annotation.Nullable + private String htlcOrigin; + + public static final String SERIALIZED_NAME_KIMAGE_OR_MS_ID = "kimage_or_ms_id"; + @SerializedName(SERIALIZED_NAME_KIMAGE_OR_MS_ID) + @javax.annotation.Nullable + private String kimageOrMsId; + + public static final String SERIALIZED_NAME_MULTISIG_COUNT = "multisig_count"; + @SerializedName(SERIALIZED_NAME_MULTISIG_COUNT) + @javax.annotation.Nullable + private Integer multisigCount; + + public TransactionInputModel() { + } + + public TransactionInputModel amount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + */ + @javax.annotation.Nullable + public Integer getAmount() { + return amount; + } + + public void setAmount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + } + + + public TransactionInputModel globalIndexes(@javax.annotation.Nullable List globalIndexes) { + this.globalIndexes = globalIndexes; + return this; + } + + public TransactionInputModel addGlobalIndexesItem(Integer globalIndexesItem) { + if (this.globalIndexes == null) { + this.globalIndexes = new ArrayList<>(); + } + this.globalIndexes.add(globalIndexesItem); + return this; + } + + /** + * Get globalIndexes + * @return globalIndexes + */ + @javax.annotation.Nullable + public List getGlobalIndexes() { + return globalIndexes; + } + + public void setGlobalIndexes(@javax.annotation.Nullable List globalIndexes) { + this.globalIndexes = globalIndexes; + } + + + public TransactionInputModel htlcOrigin(@javax.annotation.Nullable String htlcOrigin) { + this.htlcOrigin = htlcOrigin; + return this; + } + + /** + * Get htlcOrigin + * @return htlcOrigin + */ + @javax.annotation.Nullable + public String getHtlcOrigin() { + return htlcOrigin; + } + + public void setHtlcOrigin(@javax.annotation.Nullable String htlcOrigin) { + this.htlcOrigin = htlcOrigin; + } + + + public TransactionInputModel kimageOrMsId(@javax.annotation.Nullable String kimageOrMsId) { + this.kimageOrMsId = kimageOrMsId; + return this; + } + + /** + * Get kimageOrMsId + * @return kimageOrMsId + */ + @javax.annotation.Nullable + public String getKimageOrMsId() { + return kimageOrMsId; + } + + public void setKimageOrMsId(@javax.annotation.Nullable String kimageOrMsId) { + this.kimageOrMsId = kimageOrMsId; + } + + + public TransactionInputModel multisigCount(@javax.annotation.Nullable Integer multisigCount) { + this.multisigCount = multisigCount; + return this; + } + + /** + * Get multisigCount + * minimum: 0 + * maximum: 4294967295 + * @return multisigCount + */ + @javax.annotation.Nullable + public Integer getMultisigCount() { + return multisigCount; + } + + public void setMultisigCount(@javax.annotation.Nullable Integer multisigCount) { + this.multisigCount = multisigCount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionInputModel transactionInputModel = (TransactionInputModel) o; + return Objects.equals(this.amount, transactionInputModel.amount) && + Objects.equals(this.globalIndexes, transactionInputModel.globalIndexes) && + Objects.equals(this.htlcOrigin, transactionInputModel.htlcOrigin) && + Objects.equals(this.kimageOrMsId, transactionInputModel.kimageOrMsId) && + Objects.equals(this.multisigCount, transactionInputModel.multisigCount); + } + + @Override + public int hashCode() { + return Objects.hash(amount, globalIndexes, htlcOrigin, kimageOrMsId, multisigCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionInputModel {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" globalIndexes: ").append(toIndentedString(globalIndexes)).append("\n"); + sb.append(" htlcOrigin: ").append(toIndentedString(htlcOrigin)).append("\n"); + sb.append(" kimageOrMsId: ").append(toIndentedString(kimageOrMsId)).append("\n"); + sb.append(" multisigCount: ").append(toIndentedString(multisigCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("amount", "global_indexes", "htlc_origin", "kimage_or_ms_id", "multisig_count")); + + // 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 TransactionInputModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TransactionInputModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TransactionInputModel is not found in the empty JSON string", TransactionInputModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TransactionInputModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TransactionInputModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("global_indexes") != null && !jsonObj.get("global_indexes").isJsonNull() && !jsonObj.get("global_indexes").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `global_indexes` to be an array in the JSON string but got `%s`", jsonObj.get("global_indexes").toString())); + } + if ((jsonObj.get("htlc_origin") != null && !jsonObj.get("htlc_origin").isJsonNull()) && !jsonObj.get("htlc_origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `htlc_origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htlc_origin").toString())); + } + if ((jsonObj.get("kimage_or_ms_id") != null && !jsonObj.get("kimage_or_ms_id").isJsonNull()) && !jsonObj.get("kimage_or_ms_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `kimage_or_ms_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kimage_or_ms_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionInputModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionInputModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionInputModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionInputModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionInputModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionInputModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionInputModel + * @throws IOException if the JSON string is invalid with respect to TransactionInputModel + */ + public static TransactionInputModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionInputModel.class); + } + + /** + * Convert an instance of TransactionInputModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionOutputModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionOutputModel.java new file mode 100644 index 00000000..7b73eae6 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TransactionOutputModel.java @@ -0,0 +1,324 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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 java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TransactionOutputModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TransactionOutputModel { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + @javax.annotation.Nullable + private Integer amount; + + public static final String SERIALIZED_NAME_GLOBAL_INDEX = "global_index"; + @SerializedName(SERIALIZED_NAME_GLOBAL_INDEX) + @javax.annotation.Nullable + private Integer globalIndex; + + public static final String SERIALIZED_NAME_IS_SPENT = "is_spent"; + @SerializedName(SERIALIZED_NAME_IS_SPENT) + @javax.annotation.Nullable + private Boolean isSpent; + + public static final String SERIALIZED_NAME_MINIMUM_SIGS = "minimum_sigs"; + @SerializedName(SERIALIZED_NAME_MINIMUM_SIGS) + @javax.annotation.Nullable + private Integer minimumSigs; + + public static final String SERIALIZED_NAME_PUB_KEYS = "pub_keys"; + @SerializedName(SERIALIZED_NAME_PUB_KEYS) + @javax.annotation.Nullable + private List pubKeys = new ArrayList<>(); + + public TransactionOutputModel() { + } + + public TransactionOutputModel amount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + */ + @javax.annotation.Nullable + public Integer getAmount() { + return amount; + } + + public void setAmount(@javax.annotation.Nullable Integer amount) { + this.amount = amount; + } + + + public TransactionOutputModel globalIndex(@javax.annotation.Nullable Integer globalIndex) { + this.globalIndex = globalIndex; + return this; + } + + /** + * Get globalIndex + * @return globalIndex + */ + @javax.annotation.Nullable + public Integer getGlobalIndex() { + return globalIndex; + } + + public void setGlobalIndex(@javax.annotation.Nullable Integer globalIndex) { + this.globalIndex = globalIndex; + } + + + public TransactionOutputModel isSpent(@javax.annotation.Nullable Boolean isSpent) { + this.isSpent = isSpent; + return this; + } + + /** + * Get isSpent + * @return isSpent + */ + @javax.annotation.Nullable + public Boolean getIsSpent() { + return isSpent; + } + + public void setIsSpent(@javax.annotation.Nullable Boolean isSpent) { + this.isSpent = isSpent; + } + + + public TransactionOutputModel minimumSigs(@javax.annotation.Nullable Integer minimumSigs) { + this.minimumSigs = minimumSigs; + return this; + } + + /** + * Get minimumSigs + * minimum: 0 + * maximum: 4294967295 + * @return minimumSigs + */ + @javax.annotation.Nullable + public Integer getMinimumSigs() { + return minimumSigs; + } + + public void setMinimumSigs(@javax.annotation.Nullable Integer minimumSigs) { + this.minimumSigs = minimumSigs; + } + + + public TransactionOutputModel pubKeys(@javax.annotation.Nullable List pubKeys) { + this.pubKeys = pubKeys; + return this; + } + + public TransactionOutputModel addPubKeysItem(String pubKeysItem) { + if (this.pubKeys == null) { + this.pubKeys = new ArrayList<>(); + } + this.pubKeys.add(pubKeysItem); + return this; + } + + /** + * Get pubKeys + * @return pubKeys + */ + @javax.annotation.Nullable + public List getPubKeys() { + return pubKeys; + } + + public void setPubKeys(@javax.annotation.Nullable List pubKeys) { + this.pubKeys = pubKeys; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionOutputModel transactionOutputModel = (TransactionOutputModel) o; + return Objects.equals(this.amount, transactionOutputModel.amount) && + Objects.equals(this.globalIndex, transactionOutputModel.globalIndex) && + Objects.equals(this.isSpent, transactionOutputModel.isSpent) && + Objects.equals(this.minimumSigs, transactionOutputModel.minimumSigs) && + Objects.equals(this.pubKeys, transactionOutputModel.pubKeys); + } + + @Override + public int hashCode() { + return Objects.hash(amount, globalIndex, isSpent, minimumSigs, pubKeys); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionOutputModel {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" globalIndex: ").append(toIndentedString(globalIndex)).append("\n"); + sb.append(" isSpent: ").append(toIndentedString(isSpent)).append("\n"); + sb.append(" minimumSigs: ").append(toIndentedString(minimumSigs)).append("\n"); + sb.append(" pubKeys: ").append(toIndentedString(pubKeys)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("amount", "global_index", "is_spent", "minimum_sigs", "pub_keys")); + + // 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 TransactionOutputModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TransactionOutputModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TransactionOutputModel is not found in the empty JSON string", TransactionOutputModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TransactionOutputModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TransactionOutputModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("pub_keys") != null && !jsonObj.get("pub_keys").isJsonNull() && !jsonObj.get("pub_keys").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pub_keys` to be an array in the JSON string but got `%s`", jsonObj.get("pub_keys").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionOutputModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionOutputModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionOutputModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionOutputModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionOutputModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionOutputModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionOutputModel + * @throws IOException if the JSON string is invalid with respect to TransactionOutputModel + */ + public static TransactionOutputModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionOutputModel.class); + } + + /** + * Convert an instance of TransactionOutputModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxGenerationContextModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxGenerationContextModel.java new file mode 100644 index 00000000..185243dd --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxGenerationContextModel.java @@ -0,0 +1,963 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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 java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TxGenerationContextModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TxGenerationContextModel { + public static final String SERIALIZED_NAME_ASSET_IDS = "asset_ids"; + @SerializedName(SERIALIZED_NAME_ASSET_IDS) + @javax.annotation.Nullable + private List assetIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BLINDED_ASSET_IDS = "blinded_asset_ids"; + @SerializedName(SERIALIZED_NAME_BLINDED_ASSET_IDS) + @javax.annotation.Nullable + private List blindedAssetIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AMOUNT_COMMITMENTS = "amount_commitments"; + @SerializedName(SERIALIZED_NAME_AMOUNT_COMMITMENTS) + @javax.annotation.Nullable + private List amountCommitments = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ASSET_ID_BLINDING_MASKS = "asset_id_blinding_masks"; + @SerializedName(SERIALIZED_NAME_ASSET_ID_BLINDING_MASKS) + @javax.annotation.Nullable + private List assetIdBlindingMasks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AMOUNTS = "amounts"; + @SerializedName(SERIALIZED_NAME_AMOUNTS) + @javax.annotation.Nullable + private List amounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AMOUNT_BLINDING_MASKS = "amount_blinding_masks"; + @SerializedName(SERIALIZED_NAME_AMOUNT_BLINDING_MASKS) + @javax.annotation.Nullable + private List amountBlindingMasks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PSEUDO_OUTS_BLINDED_ASSET_IDS = "pseudo_outs_blinded_asset_ids"; + @SerializedName(SERIALIZED_NAME_PSEUDO_OUTS_BLINDED_ASSET_IDS) + @javax.annotation.Nullable + private List pseudoOutsBlindedAssetIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PSEUDO_OUTS_PLUS_REAL_OUT_BLINDING_MASKS = "pseudo_outs_plus_real_out_blinding_masks"; + @SerializedName(SERIALIZED_NAME_PSEUDO_OUTS_PLUS_REAL_OUT_BLINDING_MASKS) + @javax.annotation.Nullable + private List pseudoOutsPlusRealOutBlindingMasks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REAL_ZC_INS_ASSET_IDS = "real_zc_ins_asset_ids"; + @SerializedName(SERIALIZED_NAME_REAL_ZC_INS_ASSET_IDS) + @javax.annotation.Nullable + private List realZcInsAssetIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ZC_INPUT_AMOUNTS = "zc_input_amounts"; + @SerializedName(SERIALIZED_NAME_ZC_INPUT_AMOUNTS) + @javax.annotation.Nullable + private List zcInputAmounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PSEUDO_OUT_AMOUNT_COMMITMENTS_SUM = "pseudo_out_amount_commitments_sum"; + @SerializedName(SERIALIZED_NAME_PSEUDO_OUT_AMOUNT_COMMITMENTS_SUM) + @javax.annotation.Nullable + private String pseudoOutAmountCommitmentsSum; + + public static final String SERIALIZED_NAME_PSEUDO_OUT_AMOUNT_BLINDING_MASKS_SUM = "pseudo_out_amount_blinding_masks_sum"; + @SerializedName(SERIALIZED_NAME_PSEUDO_OUT_AMOUNT_BLINDING_MASKS_SUM) + @javax.annotation.Nullable + private String pseudoOutAmountBlindingMasksSum; + + public static final String SERIALIZED_NAME_REAL_IN_ASSET_ID_BLINDING_MASK_X_AMOUNT_SUM = "real_in_asset_id_blinding_mask_x_amount_sum"; + @SerializedName(SERIALIZED_NAME_REAL_IN_ASSET_ID_BLINDING_MASK_X_AMOUNT_SUM) + @javax.annotation.Nullable + private String realInAssetIdBlindingMaskXAmountSum; + + public static final String SERIALIZED_NAME_AMOUNT_COMMITMENTS_SUM = "amount_commitments_sum"; + @SerializedName(SERIALIZED_NAME_AMOUNT_COMMITMENTS_SUM) + @javax.annotation.Nullable + private String amountCommitmentsSum; + + public static final String SERIALIZED_NAME_AMOUNT_BLINDING_MASKS_SUM = "amount_blinding_masks_sum"; + @SerializedName(SERIALIZED_NAME_AMOUNT_BLINDING_MASKS_SUM) + @javax.annotation.Nullable + private String amountBlindingMasksSum; + + public static final String SERIALIZED_NAME_ASSET_ID_BLINDING_MASK_X_AMOUNT_SUM = "asset_id_blinding_mask_x_amount_sum"; + @SerializedName(SERIALIZED_NAME_ASSET_ID_BLINDING_MASK_X_AMOUNT_SUM) + @javax.annotation.Nullable + private String assetIdBlindingMaskXAmountSum; + + public static final String SERIALIZED_NAME_AO_ASSET_ID = "ao_asset_id"; + @SerializedName(SERIALIZED_NAME_AO_ASSET_ID) + @javax.annotation.Nullable + private String aoAssetId; + + public static final String SERIALIZED_NAME_AO_ASSET_ID_PT = "ao_asset_id_pt"; + @SerializedName(SERIALIZED_NAME_AO_ASSET_ID_PT) + @javax.annotation.Nullable + private String aoAssetIdPt; + + public static final String SERIALIZED_NAME_AO_AMOUNT_COMMITMENT = "ao_amount_commitment"; + @SerializedName(SERIALIZED_NAME_AO_AMOUNT_COMMITMENT) + @javax.annotation.Nullable + private String aoAmountCommitment; + + public static final String SERIALIZED_NAME_AO_AMOUNT_BLINDING_MASK = "ao_amount_blinding_mask"; + @SerializedName(SERIALIZED_NAME_AO_AMOUNT_BLINDING_MASK) + @javax.annotation.Nullable + private String aoAmountBlindingMask; + + public static final String SERIALIZED_NAME_AO_COMMITMENT_IN_OUTPUTS = "ao_commitment_in_outputs"; + @SerializedName(SERIALIZED_NAME_AO_COMMITMENT_IN_OUTPUTS) + @javax.annotation.Nullable + private Boolean aoCommitmentInOutputs; + + public static final String SERIALIZED_NAME_TX_KEY_PUB = "tx_key_pub"; + @SerializedName(SERIALIZED_NAME_TX_KEY_PUB) + @javax.annotation.Nullable + private String txKeyPub; + + public static final String SERIALIZED_NAME_TX_KEY_SEC = "tx_key_sec"; + @SerializedName(SERIALIZED_NAME_TX_KEY_SEC) + @javax.annotation.Nullable + private String txKeySec; + + public static final String SERIALIZED_NAME_TX_PUB_KEY_P = "tx_pub_key_p"; + @SerializedName(SERIALIZED_NAME_TX_PUB_KEY_P) + @javax.annotation.Nullable + private String txPubKeyP; + + public TxGenerationContextModel() { + } + + public TxGenerationContextModel assetIds(@javax.annotation.Nullable List assetIds) { + this.assetIds = assetIds; + return this; + } + + public TxGenerationContextModel addAssetIdsItem(String assetIdsItem) { + if (this.assetIds == null) { + this.assetIds = new ArrayList<>(); + } + this.assetIds.add(assetIdsItem); + return this; + } + + /** + * Get assetIds + * @return assetIds + */ + @javax.annotation.Nullable + public List getAssetIds() { + return assetIds; + } + + public void setAssetIds(@javax.annotation.Nullable List assetIds) { + this.assetIds = assetIds; + } + + + public TxGenerationContextModel blindedAssetIds(@javax.annotation.Nullable List blindedAssetIds) { + this.blindedAssetIds = blindedAssetIds; + return this; + } + + public TxGenerationContextModel addBlindedAssetIdsItem(String blindedAssetIdsItem) { + if (this.blindedAssetIds == null) { + this.blindedAssetIds = new ArrayList<>(); + } + this.blindedAssetIds.add(blindedAssetIdsItem); + return this; + } + + /** + * Get blindedAssetIds + * @return blindedAssetIds + */ + @javax.annotation.Nullable + public List getBlindedAssetIds() { + return blindedAssetIds; + } + + public void setBlindedAssetIds(@javax.annotation.Nullable List blindedAssetIds) { + this.blindedAssetIds = blindedAssetIds; + } + + + public TxGenerationContextModel amountCommitments(@javax.annotation.Nullable List amountCommitments) { + this.amountCommitments = amountCommitments; + return this; + } + + public TxGenerationContextModel addAmountCommitmentsItem(String amountCommitmentsItem) { + if (this.amountCommitments == null) { + this.amountCommitments = new ArrayList<>(); + } + this.amountCommitments.add(amountCommitmentsItem); + return this; + } + + /** + * Get amountCommitments + * @return amountCommitments + */ + @javax.annotation.Nullable + public List getAmountCommitments() { + return amountCommitments; + } + + public void setAmountCommitments(@javax.annotation.Nullable List amountCommitments) { + this.amountCommitments = amountCommitments; + } + + + public TxGenerationContextModel assetIdBlindingMasks(@javax.annotation.Nullable List assetIdBlindingMasks) { + this.assetIdBlindingMasks = assetIdBlindingMasks; + return this; + } + + public TxGenerationContextModel addAssetIdBlindingMasksItem(String assetIdBlindingMasksItem) { + if (this.assetIdBlindingMasks == null) { + this.assetIdBlindingMasks = new ArrayList<>(); + } + this.assetIdBlindingMasks.add(assetIdBlindingMasksItem); + return this; + } + + /** + * Get assetIdBlindingMasks + * @return assetIdBlindingMasks + */ + @javax.annotation.Nullable + public List getAssetIdBlindingMasks() { + return assetIdBlindingMasks; + } + + public void setAssetIdBlindingMasks(@javax.annotation.Nullable List assetIdBlindingMasks) { + this.assetIdBlindingMasks = assetIdBlindingMasks; + } + + + public TxGenerationContextModel amounts(@javax.annotation.Nullable List amounts) { + this.amounts = amounts; + return this; + } + + public TxGenerationContextModel addAmountsItem(String amountsItem) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.add(amountsItem); + return this; + } + + /** + * Get amounts + * @return amounts + */ + @javax.annotation.Nullable + public List getAmounts() { + return amounts; + } + + public void setAmounts(@javax.annotation.Nullable List amounts) { + this.amounts = amounts; + } + + + public TxGenerationContextModel amountBlindingMasks(@javax.annotation.Nullable List amountBlindingMasks) { + this.amountBlindingMasks = amountBlindingMasks; + return this; + } + + public TxGenerationContextModel addAmountBlindingMasksItem(String amountBlindingMasksItem) { + if (this.amountBlindingMasks == null) { + this.amountBlindingMasks = new ArrayList<>(); + } + this.amountBlindingMasks.add(amountBlindingMasksItem); + return this; + } + + /** + * Get amountBlindingMasks + * @return amountBlindingMasks + */ + @javax.annotation.Nullable + public List getAmountBlindingMasks() { + return amountBlindingMasks; + } + + public void setAmountBlindingMasks(@javax.annotation.Nullable List amountBlindingMasks) { + this.amountBlindingMasks = amountBlindingMasks; + } + + + public TxGenerationContextModel pseudoOutsBlindedAssetIds(@javax.annotation.Nullable List pseudoOutsBlindedAssetIds) { + this.pseudoOutsBlindedAssetIds = pseudoOutsBlindedAssetIds; + return this; + } + + public TxGenerationContextModel addPseudoOutsBlindedAssetIdsItem(String pseudoOutsBlindedAssetIdsItem) { + if (this.pseudoOutsBlindedAssetIds == null) { + this.pseudoOutsBlindedAssetIds = new ArrayList<>(); + } + this.pseudoOutsBlindedAssetIds.add(pseudoOutsBlindedAssetIdsItem); + return this; + } + + /** + * Get pseudoOutsBlindedAssetIds + * @return pseudoOutsBlindedAssetIds + */ + @javax.annotation.Nullable + public List getPseudoOutsBlindedAssetIds() { + return pseudoOutsBlindedAssetIds; + } + + public void setPseudoOutsBlindedAssetIds(@javax.annotation.Nullable List pseudoOutsBlindedAssetIds) { + this.pseudoOutsBlindedAssetIds = pseudoOutsBlindedAssetIds; + } + + + public TxGenerationContextModel pseudoOutsPlusRealOutBlindingMasks(@javax.annotation.Nullable List pseudoOutsPlusRealOutBlindingMasks) { + this.pseudoOutsPlusRealOutBlindingMasks = pseudoOutsPlusRealOutBlindingMasks; + return this; + } + + public TxGenerationContextModel addPseudoOutsPlusRealOutBlindingMasksItem(String pseudoOutsPlusRealOutBlindingMasksItem) { + if (this.pseudoOutsPlusRealOutBlindingMasks == null) { + this.pseudoOutsPlusRealOutBlindingMasks = new ArrayList<>(); + } + this.pseudoOutsPlusRealOutBlindingMasks.add(pseudoOutsPlusRealOutBlindingMasksItem); + return this; + } + + /** + * Get pseudoOutsPlusRealOutBlindingMasks + * @return pseudoOutsPlusRealOutBlindingMasks + */ + @javax.annotation.Nullable + public List getPseudoOutsPlusRealOutBlindingMasks() { + return pseudoOutsPlusRealOutBlindingMasks; + } + + public void setPseudoOutsPlusRealOutBlindingMasks(@javax.annotation.Nullable List pseudoOutsPlusRealOutBlindingMasks) { + this.pseudoOutsPlusRealOutBlindingMasks = pseudoOutsPlusRealOutBlindingMasks; + } + + + public TxGenerationContextModel realZcInsAssetIds(@javax.annotation.Nullable List realZcInsAssetIds) { + this.realZcInsAssetIds = realZcInsAssetIds; + return this; + } + + public TxGenerationContextModel addRealZcInsAssetIdsItem(String realZcInsAssetIdsItem) { + if (this.realZcInsAssetIds == null) { + this.realZcInsAssetIds = new ArrayList<>(); + } + this.realZcInsAssetIds.add(realZcInsAssetIdsItem); + return this; + } + + /** + * Get realZcInsAssetIds + * @return realZcInsAssetIds + */ + @javax.annotation.Nullable + public List getRealZcInsAssetIds() { + return realZcInsAssetIds; + } + + public void setRealZcInsAssetIds(@javax.annotation.Nullable List realZcInsAssetIds) { + this.realZcInsAssetIds = realZcInsAssetIds; + } + + + public TxGenerationContextModel zcInputAmounts(@javax.annotation.Nullable List zcInputAmounts) { + this.zcInputAmounts = zcInputAmounts; + return this; + } + + public TxGenerationContextModel addZcInputAmountsItem(Integer zcInputAmountsItem) { + if (this.zcInputAmounts == null) { + this.zcInputAmounts = new ArrayList<>(); + } + this.zcInputAmounts.add(zcInputAmountsItem); + return this; + } + + /** + * Get zcInputAmounts + * @return zcInputAmounts + */ + @javax.annotation.Nullable + public List getZcInputAmounts() { + return zcInputAmounts; + } + + public void setZcInputAmounts(@javax.annotation.Nullable List zcInputAmounts) { + this.zcInputAmounts = zcInputAmounts; + } + + + public TxGenerationContextModel pseudoOutAmountCommitmentsSum(@javax.annotation.Nullable String pseudoOutAmountCommitmentsSum) { + this.pseudoOutAmountCommitmentsSum = pseudoOutAmountCommitmentsSum; + return this; + } + + /** + * Get pseudoOutAmountCommitmentsSum + * @return pseudoOutAmountCommitmentsSum + */ + @javax.annotation.Nullable + public String getPseudoOutAmountCommitmentsSum() { + return pseudoOutAmountCommitmentsSum; + } + + public void setPseudoOutAmountCommitmentsSum(@javax.annotation.Nullable String pseudoOutAmountCommitmentsSum) { + this.pseudoOutAmountCommitmentsSum = pseudoOutAmountCommitmentsSum; + } + + + public TxGenerationContextModel pseudoOutAmountBlindingMasksSum(@javax.annotation.Nullable String pseudoOutAmountBlindingMasksSum) { + this.pseudoOutAmountBlindingMasksSum = pseudoOutAmountBlindingMasksSum; + return this; + } + + /** + * Get pseudoOutAmountBlindingMasksSum + * @return pseudoOutAmountBlindingMasksSum + */ + @javax.annotation.Nullable + public String getPseudoOutAmountBlindingMasksSum() { + return pseudoOutAmountBlindingMasksSum; + } + + public void setPseudoOutAmountBlindingMasksSum(@javax.annotation.Nullable String pseudoOutAmountBlindingMasksSum) { + this.pseudoOutAmountBlindingMasksSum = pseudoOutAmountBlindingMasksSum; + } + + + public TxGenerationContextModel realInAssetIdBlindingMaskXAmountSum(@javax.annotation.Nullable String realInAssetIdBlindingMaskXAmountSum) { + this.realInAssetIdBlindingMaskXAmountSum = realInAssetIdBlindingMaskXAmountSum; + return this; + } + + /** + * Get realInAssetIdBlindingMaskXAmountSum + * @return realInAssetIdBlindingMaskXAmountSum + */ + @javax.annotation.Nullable + public String getRealInAssetIdBlindingMaskXAmountSum() { + return realInAssetIdBlindingMaskXAmountSum; + } + + public void setRealInAssetIdBlindingMaskXAmountSum(@javax.annotation.Nullable String realInAssetIdBlindingMaskXAmountSum) { + this.realInAssetIdBlindingMaskXAmountSum = realInAssetIdBlindingMaskXAmountSum; + } + + + public TxGenerationContextModel amountCommitmentsSum(@javax.annotation.Nullable String amountCommitmentsSum) { + this.amountCommitmentsSum = amountCommitmentsSum; + return this; + } + + /** + * Get amountCommitmentsSum + * @return amountCommitmentsSum + */ + @javax.annotation.Nullable + public String getAmountCommitmentsSum() { + return amountCommitmentsSum; + } + + public void setAmountCommitmentsSum(@javax.annotation.Nullable String amountCommitmentsSum) { + this.amountCommitmentsSum = amountCommitmentsSum; + } + + + public TxGenerationContextModel amountBlindingMasksSum(@javax.annotation.Nullable String amountBlindingMasksSum) { + this.amountBlindingMasksSum = amountBlindingMasksSum; + return this; + } + + /** + * Get amountBlindingMasksSum + * @return amountBlindingMasksSum + */ + @javax.annotation.Nullable + public String getAmountBlindingMasksSum() { + return amountBlindingMasksSum; + } + + public void setAmountBlindingMasksSum(@javax.annotation.Nullable String amountBlindingMasksSum) { + this.amountBlindingMasksSum = amountBlindingMasksSum; + } + + + public TxGenerationContextModel assetIdBlindingMaskXAmountSum(@javax.annotation.Nullable String assetIdBlindingMaskXAmountSum) { + this.assetIdBlindingMaskXAmountSum = assetIdBlindingMaskXAmountSum; + return this; + } + + /** + * Get assetIdBlindingMaskXAmountSum + * @return assetIdBlindingMaskXAmountSum + */ + @javax.annotation.Nullable + public String getAssetIdBlindingMaskXAmountSum() { + return assetIdBlindingMaskXAmountSum; + } + + public void setAssetIdBlindingMaskXAmountSum(@javax.annotation.Nullable String assetIdBlindingMaskXAmountSum) { + this.assetIdBlindingMaskXAmountSum = assetIdBlindingMaskXAmountSum; + } + + + public TxGenerationContextModel aoAssetId(@javax.annotation.Nullable String aoAssetId) { + this.aoAssetId = aoAssetId; + return this; + } + + /** + * Get aoAssetId + * @return aoAssetId + */ + @javax.annotation.Nullable + public String getAoAssetId() { + return aoAssetId; + } + + public void setAoAssetId(@javax.annotation.Nullable String aoAssetId) { + this.aoAssetId = aoAssetId; + } + + + public TxGenerationContextModel aoAssetIdPt(@javax.annotation.Nullable String aoAssetIdPt) { + this.aoAssetIdPt = aoAssetIdPt; + return this; + } + + /** + * Get aoAssetIdPt + * @return aoAssetIdPt + */ + @javax.annotation.Nullable + public String getAoAssetIdPt() { + return aoAssetIdPt; + } + + public void setAoAssetIdPt(@javax.annotation.Nullable String aoAssetIdPt) { + this.aoAssetIdPt = aoAssetIdPt; + } + + + public TxGenerationContextModel aoAmountCommitment(@javax.annotation.Nullable String aoAmountCommitment) { + this.aoAmountCommitment = aoAmountCommitment; + return this; + } + + /** + * Get aoAmountCommitment + * @return aoAmountCommitment + */ + @javax.annotation.Nullable + public String getAoAmountCommitment() { + return aoAmountCommitment; + } + + public void setAoAmountCommitment(@javax.annotation.Nullable String aoAmountCommitment) { + this.aoAmountCommitment = aoAmountCommitment; + } + + + public TxGenerationContextModel aoAmountBlindingMask(@javax.annotation.Nullable String aoAmountBlindingMask) { + this.aoAmountBlindingMask = aoAmountBlindingMask; + return this; + } + + /** + * Get aoAmountBlindingMask + * @return aoAmountBlindingMask + */ + @javax.annotation.Nullable + public String getAoAmountBlindingMask() { + return aoAmountBlindingMask; + } + + public void setAoAmountBlindingMask(@javax.annotation.Nullable String aoAmountBlindingMask) { + this.aoAmountBlindingMask = aoAmountBlindingMask; + } + + + public TxGenerationContextModel aoCommitmentInOutputs(@javax.annotation.Nullable Boolean aoCommitmentInOutputs) { + this.aoCommitmentInOutputs = aoCommitmentInOutputs; + return this; + } + + /** + * Get aoCommitmentInOutputs + * @return aoCommitmentInOutputs + */ + @javax.annotation.Nullable + public Boolean getAoCommitmentInOutputs() { + return aoCommitmentInOutputs; + } + + public void setAoCommitmentInOutputs(@javax.annotation.Nullable Boolean aoCommitmentInOutputs) { + this.aoCommitmentInOutputs = aoCommitmentInOutputs; + } + + + public TxGenerationContextModel txKeyPub(@javax.annotation.Nullable String txKeyPub) { + this.txKeyPub = txKeyPub; + return this; + } + + /** + * Get txKeyPub + * @return txKeyPub + */ + @javax.annotation.Nullable + public String getTxKeyPub() { + return txKeyPub; + } + + public void setTxKeyPub(@javax.annotation.Nullable String txKeyPub) { + this.txKeyPub = txKeyPub; + } + + + public TxGenerationContextModel txKeySec(@javax.annotation.Nullable String txKeySec) { + this.txKeySec = txKeySec; + return this; + } + + /** + * Get txKeySec + * @return txKeySec + */ + @javax.annotation.Nullable + public String getTxKeySec() { + return txKeySec; + } + + public void setTxKeySec(@javax.annotation.Nullable String txKeySec) { + this.txKeySec = txKeySec; + } + + + public TxGenerationContextModel txPubKeyP(@javax.annotation.Nullable String txPubKeyP) { + this.txPubKeyP = txPubKeyP; + return this; + } + + /** + * Get txPubKeyP + * @return txPubKeyP + */ + @javax.annotation.Nullable + public String getTxPubKeyP() { + return txPubKeyP; + } + + public void setTxPubKeyP(@javax.annotation.Nullable String txPubKeyP) { + this.txPubKeyP = txPubKeyP; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TxGenerationContextModel txGenerationContextModel = (TxGenerationContextModel) o; + return Objects.equals(this.assetIds, txGenerationContextModel.assetIds) && + Objects.equals(this.blindedAssetIds, txGenerationContextModel.blindedAssetIds) && + Objects.equals(this.amountCommitments, txGenerationContextModel.amountCommitments) && + Objects.equals(this.assetIdBlindingMasks, txGenerationContextModel.assetIdBlindingMasks) && + Objects.equals(this.amounts, txGenerationContextModel.amounts) && + Objects.equals(this.amountBlindingMasks, txGenerationContextModel.amountBlindingMasks) && + Objects.equals(this.pseudoOutsBlindedAssetIds, txGenerationContextModel.pseudoOutsBlindedAssetIds) && + Objects.equals(this.pseudoOutsPlusRealOutBlindingMasks, txGenerationContextModel.pseudoOutsPlusRealOutBlindingMasks) && + Objects.equals(this.realZcInsAssetIds, txGenerationContextModel.realZcInsAssetIds) && + Objects.equals(this.zcInputAmounts, txGenerationContextModel.zcInputAmounts) && + Objects.equals(this.pseudoOutAmountCommitmentsSum, txGenerationContextModel.pseudoOutAmountCommitmentsSum) && + Objects.equals(this.pseudoOutAmountBlindingMasksSum, txGenerationContextModel.pseudoOutAmountBlindingMasksSum) && + Objects.equals(this.realInAssetIdBlindingMaskXAmountSum, txGenerationContextModel.realInAssetIdBlindingMaskXAmountSum) && + Objects.equals(this.amountCommitmentsSum, txGenerationContextModel.amountCommitmentsSum) && + Objects.equals(this.amountBlindingMasksSum, txGenerationContextModel.amountBlindingMasksSum) && + Objects.equals(this.assetIdBlindingMaskXAmountSum, txGenerationContextModel.assetIdBlindingMaskXAmountSum) && + Objects.equals(this.aoAssetId, txGenerationContextModel.aoAssetId) && + Objects.equals(this.aoAssetIdPt, txGenerationContextModel.aoAssetIdPt) && + Objects.equals(this.aoAmountCommitment, txGenerationContextModel.aoAmountCommitment) && + Objects.equals(this.aoAmountBlindingMask, txGenerationContextModel.aoAmountBlindingMask) && + Objects.equals(this.aoCommitmentInOutputs, txGenerationContextModel.aoCommitmentInOutputs) && + Objects.equals(this.txKeyPub, txGenerationContextModel.txKeyPub) && + Objects.equals(this.txKeySec, txGenerationContextModel.txKeySec) && + Objects.equals(this.txPubKeyP, txGenerationContextModel.txPubKeyP); + } + + @Override + public int hashCode() { + return Objects.hash(assetIds, blindedAssetIds, amountCommitments, assetIdBlindingMasks, amounts, amountBlindingMasks, pseudoOutsBlindedAssetIds, pseudoOutsPlusRealOutBlindingMasks, realZcInsAssetIds, zcInputAmounts, pseudoOutAmountCommitmentsSum, pseudoOutAmountBlindingMasksSum, realInAssetIdBlindingMaskXAmountSum, amountCommitmentsSum, amountBlindingMasksSum, assetIdBlindingMaskXAmountSum, aoAssetId, aoAssetIdPt, aoAmountCommitment, aoAmountBlindingMask, aoCommitmentInOutputs, txKeyPub, txKeySec, txPubKeyP); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TxGenerationContextModel {\n"); + sb.append(" assetIds: ").append(toIndentedString(assetIds)).append("\n"); + sb.append(" blindedAssetIds: ").append(toIndentedString(blindedAssetIds)).append("\n"); + sb.append(" amountCommitments: ").append(toIndentedString(amountCommitments)).append("\n"); + sb.append(" assetIdBlindingMasks: ").append(toIndentedString(assetIdBlindingMasks)).append("\n"); + sb.append(" amounts: ").append(toIndentedString(amounts)).append("\n"); + sb.append(" amountBlindingMasks: ").append(toIndentedString(amountBlindingMasks)).append("\n"); + sb.append(" pseudoOutsBlindedAssetIds: ").append(toIndentedString(pseudoOutsBlindedAssetIds)).append("\n"); + sb.append(" pseudoOutsPlusRealOutBlindingMasks: ").append(toIndentedString(pseudoOutsPlusRealOutBlindingMasks)).append("\n"); + sb.append(" realZcInsAssetIds: ").append(toIndentedString(realZcInsAssetIds)).append("\n"); + sb.append(" zcInputAmounts: ").append(toIndentedString(zcInputAmounts)).append("\n"); + sb.append(" pseudoOutAmountCommitmentsSum: ").append(toIndentedString(pseudoOutAmountCommitmentsSum)).append("\n"); + sb.append(" pseudoOutAmountBlindingMasksSum: ").append(toIndentedString(pseudoOutAmountBlindingMasksSum)).append("\n"); + sb.append(" realInAssetIdBlindingMaskXAmountSum: ").append(toIndentedString(realInAssetIdBlindingMaskXAmountSum)).append("\n"); + sb.append(" amountCommitmentsSum: ").append(toIndentedString(amountCommitmentsSum)).append("\n"); + sb.append(" amountBlindingMasksSum: ").append(toIndentedString(amountBlindingMasksSum)).append("\n"); + sb.append(" assetIdBlindingMaskXAmountSum: ").append(toIndentedString(assetIdBlindingMaskXAmountSum)).append("\n"); + sb.append(" aoAssetId: ").append(toIndentedString(aoAssetId)).append("\n"); + sb.append(" aoAssetIdPt: ").append(toIndentedString(aoAssetIdPt)).append("\n"); + sb.append(" aoAmountCommitment: ").append(toIndentedString(aoAmountCommitment)).append("\n"); + sb.append(" aoAmountBlindingMask: ").append(toIndentedString(aoAmountBlindingMask)).append("\n"); + sb.append(" aoCommitmentInOutputs: ").append(toIndentedString(aoCommitmentInOutputs)).append("\n"); + sb.append(" txKeyPub: ").append(toIndentedString(txKeyPub)).append("\n"); + sb.append(" txKeySec: ").append(toIndentedString(txKeySec)).append("\n"); + sb.append(" txPubKeyP: ").append(toIndentedString(txPubKeyP)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("asset_ids", "blinded_asset_ids", "amount_commitments", "asset_id_blinding_masks", "amounts", "amount_blinding_masks", "pseudo_outs_blinded_asset_ids", "pseudo_outs_plus_real_out_blinding_masks", "real_zc_ins_asset_ids", "zc_input_amounts", "pseudo_out_amount_commitments_sum", "pseudo_out_amount_blinding_masks_sum", "real_in_asset_id_blinding_mask_x_amount_sum", "amount_commitments_sum", "amount_blinding_masks_sum", "asset_id_blinding_mask_x_amount_sum", "ao_asset_id", "ao_asset_id_pt", "ao_amount_commitment", "ao_amount_blinding_mask", "ao_commitment_in_outputs", "tx_key_pub", "tx_key_sec", "tx_pub_key_p")); + + // 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 TxGenerationContextModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TxGenerationContextModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TxGenerationContextModel is not found in the empty JSON string", TxGenerationContextModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TxGenerationContextModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TxGenerationContextModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("asset_ids") != null && !jsonObj.get("asset_ids").isJsonNull() && !jsonObj.get("asset_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `asset_ids` to be an array in the JSON string but got `%s`", jsonObj.get("asset_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("blinded_asset_ids") != null && !jsonObj.get("blinded_asset_ids").isJsonNull() && !jsonObj.get("blinded_asset_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `blinded_asset_ids` to be an array in the JSON string but got `%s`", jsonObj.get("blinded_asset_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("amount_commitments") != null && !jsonObj.get("amount_commitments").isJsonNull() && !jsonObj.get("amount_commitments").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `amount_commitments` to be an array in the JSON string but got `%s`", jsonObj.get("amount_commitments").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("asset_id_blinding_masks") != null && !jsonObj.get("asset_id_blinding_masks").isJsonNull() && !jsonObj.get("asset_id_blinding_masks").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `asset_id_blinding_masks` to be an array in the JSON string but got `%s`", jsonObj.get("asset_id_blinding_masks").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("amounts") != null && !jsonObj.get("amounts").isJsonNull() && !jsonObj.get("amounts").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `amounts` to be an array in the JSON string but got `%s`", jsonObj.get("amounts").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("amount_blinding_masks") != null && !jsonObj.get("amount_blinding_masks").isJsonNull() && !jsonObj.get("amount_blinding_masks").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `amount_blinding_masks` to be an array in the JSON string but got `%s`", jsonObj.get("amount_blinding_masks").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("pseudo_outs_blinded_asset_ids") != null && !jsonObj.get("pseudo_outs_blinded_asset_ids").isJsonNull() && !jsonObj.get("pseudo_outs_blinded_asset_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pseudo_outs_blinded_asset_ids` to be an array in the JSON string but got `%s`", jsonObj.get("pseudo_outs_blinded_asset_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("pseudo_outs_plus_real_out_blinding_masks") != null && !jsonObj.get("pseudo_outs_plus_real_out_blinding_masks").isJsonNull() && !jsonObj.get("pseudo_outs_plus_real_out_blinding_masks").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pseudo_outs_plus_real_out_blinding_masks` to be an array in the JSON string but got `%s`", jsonObj.get("pseudo_outs_plus_real_out_blinding_masks").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("real_zc_ins_asset_ids") != null && !jsonObj.get("real_zc_ins_asset_ids").isJsonNull() && !jsonObj.get("real_zc_ins_asset_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `real_zc_ins_asset_ids` to be an array in the JSON string but got `%s`", jsonObj.get("real_zc_ins_asset_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("zc_input_amounts") != null && !jsonObj.get("zc_input_amounts").isJsonNull() && !jsonObj.get("zc_input_amounts").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `zc_input_amounts` to be an array in the JSON string but got `%s`", jsonObj.get("zc_input_amounts").toString())); + } + if ((jsonObj.get("pseudo_out_amount_commitments_sum") != null && !jsonObj.get("pseudo_out_amount_commitments_sum").isJsonNull()) && !jsonObj.get("pseudo_out_amount_commitments_sum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pseudo_out_amount_commitments_sum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pseudo_out_amount_commitments_sum").toString())); + } + if ((jsonObj.get("pseudo_out_amount_blinding_masks_sum") != null && !jsonObj.get("pseudo_out_amount_blinding_masks_sum").isJsonNull()) && !jsonObj.get("pseudo_out_amount_blinding_masks_sum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pseudo_out_amount_blinding_masks_sum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pseudo_out_amount_blinding_masks_sum").toString())); + } + if ((jsonObj.get("real_in_asset_id_blinding_mask_x_amount_sum") != null && !jsonObj.get("real_in_asset_id_blinding_mask_x_amount_sum").isJsonNull()) && !jsonObj.get("real_in_asset_id_blinding_mask_x_amount_sum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `real_in_asset_id_blinding_mask_x_amount_sum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("real_in_asset_id_blinding_mask_x_amount_sum").toString())); + } + if ((jsonObj.get("amount_commitments_sum") != null && !jsonObj.get("amount_commitments_sum").isJsonNull()) && !jsonObj.get("amount_commitments_sum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `amount_commitments_sum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amount_commitments_sum").toString())); + } + if ((jsonObj.get("amount_blinding_masks_sum") != null && !jsonObj.get("amount_blinding_masks_sum").isJsonNull()) && !jsonObj.get("amount_blinding_masks_sum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `amount_blinding_masks_sum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amount_blinding_masks_sum").toString())); + } + if ((jsonObj.get("asset_id_blinding_mask_x_amount_sum") != null && !jsonObj.get("asset_id_blinding_mask_x_amount_sum").isJsonNull()) && !jsonObj.get("asset_id_blinding_mask_x_amount_sum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `asset_id_blinding_mask_x_amount_sum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("asset_id_blinding_mask_x_amount_sum").toString())); + } + if ((jsonObj.get("ao_asset_id") != null && !jsonObj.get("ao_asset_id").isJsonNull()) && !jsonObj.get("ao_asset_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ao_asset_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ao_asset_id").toString())); + } + if ((jsonObj.get("ao_asset_id_pt") != null && !jsonObj.get("ao_asset_id_pt").isJsonNull()) && !jsonObj.get("ao_asset_id_pt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ao_asset_id_pt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ao_asset_id_pt").toString())); + } + if ((jsonObj.get("ao_amount_commitment") != null && !jsonObj.get("ao_amount_commitment").isJsonNull()) && !jsonObj.get("ao_amount_commitment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ao_amount_commitment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ao_amount_commitment").toString())); + } + if ((jsonObj.get("ao_amount_blinding_mask") != null && !jsonObj.get("ao_amount_blinding_mask").isJsonNull()) && !jsonObj.get("ao_amount_blinding_mask").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ao_amount_blinding_mask` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ao_amount_blinding_mask").toString())); + } + if ((jsonObj.get("tx_key_pub") != null && !jsonObj.get("tx_key_pub").isJsonNull()) && !jsonObj.get("tx_key_pub").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tx_key_pub` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tx_key_pub").toString())); + } + if ((jsonObj.get("tx_key_sec") != null && !jsonObj.get("tx_key_sec").isJsonNull()) && !jsonObj.get("tx_key_sec").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tx_key_sec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tx_key_sec").toString())); + } + if ((jsonObj.get("tx_pub_key_p") != null && !jsonObj.get("tx_pub_key_p").isJsonNull()) && !jsonObj.get("tx_pub_key_p").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tx_pub_key_p` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tx_pub_key_p").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TxGenerationContextModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TxGenerationContextModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TxGenerationContextModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TxGenerationContextModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TxGenerationContextModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TxGenerationContextModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TxGenerationContextModel + * @throws IOException if the JSON string is invalid with respect to TxGenerationContextModel + */ + public static TxGenerationContextModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TxGenerationContextModel.class); + } + + /** + * Convert an instance of TxGenerationContextModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxPoolPerformanceModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxPoolPerformanceModel.java new file mode 100644 index 00000000..edd666a4 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxPoolPerformanceModel.java @@ -0,0 +1,464 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TxPoolPerformanceModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TxPoolPerformanceModel { + public static final String SERIALIZED_NAME_TX_PROCESSING_TIME = "tx_processing_time"; + @SerializedName(SERIALIZED_NAME_TX_PROCESSING_TIME) + @javax.annotation.Nullable + private Integer txProcessingTime; + + public static final String SERIALIZED_NAME_CHECK_INPUTS_TYPES_SUPPORTED_TIME = "check_inputs_types_supported_time"; + @SerializedName(SERIALIZED_NAME_CHECK_INPUTS_TYPES_SUPPORTED_TIME) + @javax.annotation.Nullable + private Integer checkInputsTypesSupportedTime; + + public static final String SERIALIZED_NAME_EXPIRATION_VALIDATE_TIME = "expiration_validate_time"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_VALIDATE_TIME) + @javax.annotation.Nullable + private Integer expirationValidateTime; + + public static final String SERIALIZED_NAME_VALIDATE_AMOUNT_TIME = "validate_amount_time"; + @SerializedName(SERIALIZED_NAME_VALIDATE_AMOUNT_TIME) + @javax.annotation.Nullable + private Integer validateAmountTime; + + public static final String SERIALIZED_NAME_VALIDATE_ALIAS_TIME = "validate_alias_time"; + @SerializedName(SERIALIZED_NAME_VALIDATE_ALIAS_TIME) + @javax.annotation.Nullable + private Integer validateAliasTime; + + public static final String SERIALIZED_NAME_CHECK_KEYIMAGES_WS_MS_TIME = "check_keyimages_ws_ms_time"; + @SerializedName(SERIALIZED_NAME_CHECK_KEYIMAGES_WS_MS_TIME) + @javax.annotation.Nullable + private Integer checkKeyimagesWsMsTime; + + public static final String SERIALIZED_NAME_CHECK_INPUTS_TIME = "check_inputs_time"; + @SerializedName(SERIALIZED_NAME_CHECK_INPUTS_TIME) + @javax.annotation.Nullable + private Integer checkInputsTime; + + public static final String SERIALIZED_NAME_BEGIN_TX_TIME = "begin_tx_time"; + @SerializedName(SERIALIZED_NAME_BEGIN_TX_TIME) + @javax.annotation.Nullable + private Integer beginTxTime; + + public static final String SERIALIZED_NAME_UPDATE_DB_TIME = "update_db_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_DB_TIME) + @javax.annotation.Nullable + private Integer updateDbTime; + + public static final String SERIALIZED_NAME_DB_COMMIT_TIME = "db_commit_time"; + @SerializedName(SERIALIZED_NAME_DB_COMMIT_TIME) + @javax.annotation.Nullable + private Integer dbCommitTime; + + public static final String SERIALIZED_NAME_CHECK_POST_HF4_BALANCE = "check_post_hf4_balance"; + @SerializedName(SERIALIZED_NAME_CHECK_POST_HF4_BALANCE) + @javax.annotation.Nullable + private Integer checkPostHf4Balance; + + public TxPoolPerformanceModel() { + } + + public TxPoolPerformanceModel txProcessingTime(@javax.annotation.Nullable Integer txProcessingTime) { + this.txProcessingTime = txProcessingTime; + return this; + } + + /** + * Get txProcessingTime + * @return txProcessingTime + */ + @javax.annotation.Nullable + public Integer getTxProcessingTime() { + return txProcessingTime; + } + + public void setTxProcessingTime(@javax.annotation.Nullable Integer txProcessingTime) { + this.txProcessingTime = txProcessingTime; + } + + + public TxPoolPerformanceModel checkInputsTypesSupportedTime(@javax.annotation.Nullable Integer checkInputsTypesSupportedTime) { + this.checkInputsTypesSupportedTime = checkInputsTypesSupportedTime; + return this; + } + + /** + * Get checkInputsTypesSupportedTime + * @return checkInputsTypesSupportedTime + */ + @javax.annotation.Nullable + public Integer getCheckInputsTypesSupportedTime() { + return checkInputsTypesSupportedTime; + } + + public void setCheckInputsTypesSupportedTime(@javax.annotation.Nullable Integer checkInputsTypesSupportedTime) { + this.checkInputsTypesSupportedTime = checkInputsTypesSupportedTime; + } + + + public TxPoolPerformanceModel expirationValidateTime(@javax.annotation.Nullable Integer expirationValidateTime) { + this.expirationValidateTime = expirationValidateTime; + return this; + } + + /** + * Get expirationValidateTime + * @return expirationValidateTime + */ + @javax.annotation.Nullable + public Integer getExpirationValidateTime() { + return expirationValidateTime; + } + + public void setExpirationValidateTime(@javax.annotation.Nullable Integer expirationValidateTime) { + this.expirationValidateTime = expirationValidateTime; + } + + + public TxPoolPerformanceModel validateAmountTime(@javax.annotation.Nullable Integer validateAmountTime) { + this.validateAmountTime = validateAmountTime; + return this; + } + + /** + * Get validateAmountTime + * @return validateAmountTime + */ + @javax.annotation.Nullable + public Integer getValidateAmountTime() { + return validateAmountTime; + } + + public void setValidateAmountTime(@javax.annotation.Nullable Integer validateAmountTime) { + this.validateAmountTime = validateAmountTime; + } + + + public TxPoolPerformanceModel validateAliasTime(@javax.annotation.Nullable Integer validateAliasTime) { + this.validateAliasTime = validateAliasTime; + return this; + } + + /** + * Get validateAliasTime + * @return validateAliasTime + */ + @javax.annotation.Nullable + public Integer getValidateAliasTime() { + return validateAliasTime; + } + + public void setValidateAliasTime(@javax.annotation.Nullable Integer validateAliasTime) { + this.validateAliasTime = validateAliasTime; + } + + + public TxPoolPerformanceModel checkKeyimagesWsMsTime(@javax.annotation.Nullable Integer checkKeyimagesWsMsTime) { + this.checkKeyimagesWsMsTime = checkKeyimagesWsMsTime; + return this; + } + + /** + * Get checkKeyimagesWsMsTime + * @return checkKeyimagesWsMsTime + */ + @javax.annotation.Nullable + public Integer getCheckKeyimagesWsMsTime() { + return checkKeyimagesWsMsTime; + } + + public void setCheckKeyimagesWsMsTime(@javax.annotation.Nullable Integer checkKeyimagesWsMsTime) { + this.checkKeyimagesWsMsTime = checkKeyimagesWsMsTime; + } + + + public TxPoolPerformanceModel checkInputsTime(@javax.annotation.Nullable Integer checkInputsTime) { + this.checkInputsTime = checkInputsTime; + return this; + } + + /** + * Get checkInputsTime + * @return checkInputsTime + */ + @javax.annotation.Nullable + public Integer getCheckInputsTime() { + return checkInputsTime; + } + + public void setCheckInputsTime(@javax.annotation.Nullable Integer checkInputsTime) { + this.checkInputsTime = checkInputsTime; + } + + + public TxPoolPerformanceModel beginTxTime(@javax.annotation.Nullable Integer beginTxTime) { + this.beginTxTime = beginTxTime; + return this; + } + + /** + * Get beginTxTime + * @return beginTxTime + */ + @javax.annotation.Nullable + public Integer getBeginTxTime() { + return beginTxTime; + } + + public void setBeginTxTime(@javax.annotation.Nullable Integer beginTxTime) { + this.beginTxTime = beginTxTime; + } + + + public TxPoolPerformanceModel updateDbTime(@javax.annotation.Nullable Integer updateDbTime) { + this.updateDbTime = updateDbTime; + return this; + } + + /** + * Get updateDbTime + * @return updateDbTime + */ + @javax.annotation.Nullable + public Integer getUpdateDbTime() { + return updateDbTime; + } + + public void setUpdateDbTime(@javax.annotation.Nullable Integer updateDbTime) { + this.updateDbTime = updateDbTime; + } + + + public TxPoolPerformanceModel dbCommitTime(@javax.annotation.Nullable Integer dbCommitTime) { + this.dbCommitTime = dbCommitTime; + return this; + } + + /** + * Get dbCommitTime + * @return dbCommitTime + */ + @javax.annotation.Nullable + public Integer getDbCommitTime() { + return dbCommitTime; + } + + public void setDbCommitTime(@javax.annotation.Nullable Integer dbCommitTime) { + this.dbCommitTime = dbCommitTime; + } + + + public TxPoolPerformanceModel checkPostHf4Balance(@javax.annotation.Nullable Integer checkPostHf4Balance) { + this.checkPostHf4Balance = checkPostHf4Balance; + return this; + } + + /** + * Get checkPostHf4Balance + * @return checkPostHf4Balance + */ + @javax.annotation.Nullable + public Integer getCheckPostHf4Balance() { + return checkPostHf4Balance; + } + + public void setCheckPostHf4Balance(@javax.annotation.Nullable Integer checkPostHf4Balance) { + this.checkPostHf4Balance = checkPostHf4Balance; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TxPoolPerformanceModel txPoolPerformanceModel = (TxPoolPerformanceModel) o; + return Objects.equals(this.txProcessingTime, txPoolPerformanceModel.txProcessingTime) && + Objects.equals(this.checkInputsTypesSupportedTime, txPoolPerformanceModel.checkInputsTypesSupportedTime) && + Objects.equals(this.expirationValidateTime, txPoolPerformanceModel.expirationValidateTime) && + Objects.equals(this.validateAmountTime, txPoolPerformanceModel.validateAmountTime) && + Objects.equals(this.validateAliasTime, txPoolPerformanceModel.validateAliasTime) && + Objects.equals(this.checkKeyimagesWsMsTime, txPoolPerformanceModel.checkKeyimagesWsMsTime) && + Objects.equals(this.checkInputsTime, txPoolPerformanceModel.checkInputsTime) && + Objects.equals(this.beginTxTime, txPoolPerformanceModel.beginTxTime) && + Objects.equals(this.updateDbTime, txPoolPerformanceModel.updateDbTime) && + Objects.equals(this.dbCommitTime, txPoolPerformanceModel.dbCommitTime) && + Objects.equals(this.checkPostHf4Balance, txPoolPerformanceModel.checkPostHf4Balance); + } + + @Override + public int hashCode() { + return Objects.hash(txProcessingTime, checkInputsTypesSupportedTime, expirationValidateTime, validateAmountTime, validateAliasTime, checkKeyimagesWsMsTime, checkInputsTime, beginTxTime, updateDbTime, dbCommitTime, checkPostHf4Balance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TxPoolPerformanceModel {\n"); + sb.append(" txProcessingTime: ").append(toIndentedString(txProcessingTime)).append("\n"); + sb.append(" checkInputsTypesSupportedTime: ").append(toIndentedString(checkInputsTypesSupportedTime)).append("\n"); + sb.append(" expirationValidateTime: ").append(toIndentedString(expirationValidateTime)).append("\n"); + sb.append(" validateAmountTime: ").append(toIndentedString(validateAmountTime)).append("\n"); + sb.append(" validateAliasTime: ").append(toIndentedString(validateAliasTime)).append("\n"); + sb.append(" checkKeyimagesWsMsTime: ").append(toIndentedString(checkKeyimagesWsMsTime)).append("\n"); + sb.append(" checkInputsTime: ").append(toIndentedString(checkInputsTime)).append("\n"); + sb.append(" beginTxTime: ").append(toIndentedString(beginTxTime)).append("\n"); + sb.append(" updateDbTime: ").append(toIndentedString(updateDbTime)).append("\n"); + sb.append(" dbCommitTime: ").append(toIndentedString(dbCommitTime)).append("\n"); + sb.append(" checkPostHf4Balance: ").append(toIndentedString(checkPostHf4Balance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("tx_processing_time", "check_inputs_types_supported_time", "expiration_validate_time", "validate_amount_time", "validate_alias_time", "check_keyimages_ws_ms_time", "check_inputs_time", "begin_tx_time", "update_db_time", "db_commit_time", "check_post_hf4_balance")); + + // 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 TxPoolPerformanceModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TxPoolPerformanceModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TxPoolPerformanceModel is not found in the empty JSON string", TxPoolPerformanceModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TxPoolPerformanceModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TxPoolPerformanceModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TxPoolPerformanceModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TxPoolPerformanceModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TxPoolPerformanceModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TxPoolPerformanceModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TxPoolPerformanceModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TxPoolPerformanceModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TxPoolPerformanceModel + * @throws IOException if the JSON string is invalid with respect to TxPoolPerformanceModel + */ + public static TxPoolPerformanceModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TxPoolPerformanceModel.class); + } + + /** + * Convert an instance of TxPoolPerformanceModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxProcessingPerformanceModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxProcessingPerformanceModel.java new file mode 100644 index 00000000..091efb74 --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/TxProcessingPerformanceModel.java @@ -0,0 +1,828 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * TxProcessingPerformanceModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class TxProcessingPerformanceModel { + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS = "tx_check_inputs"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS) + @javax.annotation.Nullable + private Integer txCheckInputs; + + public static final String SERIALIZED_NAME_TX_ADD_ONE_TX = "tx_add_one_tx"; + @SerializedName(SERIALIZED_NAME_TX_ADD_ONE_TX) + @javax.annotation.Nullable + private Integer txAddOneTx; + + public static final String SERIALIZED_NAME_TX_PROCESS_EXTRA = "tx_process_extra"; + @SerializedName(SERIALIZED_NAME_TX_PROCESS_EXTRA) + @javax.annotation.Nullable + private Integer txProcessExtra; + + public static final String SERIALIZED_NAME_TX_PROCESS_ATTACHMENT = "tx_process_attachment"; + @SerializedName(SERIALIZED_NAME_TX_PROCESS_ATTACHMENT) + @javax.annotation.Nullable + private Integer txProcessAttachment; + + public static final String SERIALIZED_NAME_TX_PROCESS_INPUTS = "tx_process_inputs"; + @SerializedName(SERIALIZED_NAME_TX_PROCESS_INPUTS) + @javax.annotation.Nullable + private Integer txProcessInputs; + + public static final String SERIALIZED_NAME_TX_PUSH_GLOBAL_INDEX = "tx_push_global_index"; + @SerializedName(SERIALIZED_NAME_TX_PUSH_GLOBAL_INDEX) + @javax.annotation.Nullable + private Integer txPushGlobalIndex; + + public static final String SERIALIZED_NAME_TX_CHECK_EXIST = "tx_check_exist"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_EXIST) + @javax.annotation.Nullable + private Integer txCheckExist; + + public static final String SERIALIZED_NAME_TX_PRINT_LOG = "tx_print_log"; + @SerializedName(SERIALIZED_NAME_TX_PRINT_LOG) + @javax.annotation.Nullable + private Integer txPrintLog; + + public static final String SERIALIZED_NAME_TX_PRAPARE_APPEND = "tx_prapare_append"; + @SerializedName(SERIALIZED_NAME_TX_PRAPARE_APPEND) + @javax.annotation.Nullable + private Integer txPrapareAppend; + + public static final String SERIALIZED_NAME_TX_APPEND = "tx_append"; + @SerializedName(SERIALIZED_NAME_TX_APPEND) + @javax.annotation.Nullable + private Integer txAppend; + + public static final String SERIALIZED_NAME_TX_APPEND_RL_WAIT = "tx_append_rl_wait"; + @SerializedName(SERIALIZED_NAME_TX_APPEND_RL_WAIT) + @javax.annotation.Nullable + private Integer txAppendRlWait; + + public static final String SERIALIZED_NAME_TX_APPEND_IS_EXPIRED = "tx_append_is_expired"; + @SerializedName(SERIALIZED_NAME_TX_APPEND_IS_EXPIRED) + @javax.annotation.Nullable + private Integer txAppendIsExpired; + + public static final String SERIALIZED_NAME_TX_STORE_DB = "tx_store_db"; + @SerializedName(SERIALIZED_NAME_TX_STORE_DB) + @javax.annotation.Nullable + private Integer txStoreDb; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_PREFIX_HASH = "tx_check_inputs_prefix_hash"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_PREFIX_HASH) + @javax.annotation.Nullable + private Integer txCheckInputsPrefixHash; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_ATTACHMENT_CHECK = "tx_check_inputs_attachment_check"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_ATTACHMENT_CHECK) + @javax.annotation.Nullable + private Integer txCheckInputsAttachmentCheck; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP = "tx_check_inputs_loop"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP) + @javax.annotation.Nullable + private Integer txCheckInputsLoop; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_KIMAGE_CHECK = "tx_check_inputs_loop_kimage_check"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_KIMAGE_CHECK) + @javax.annotation.Nullable + private Integer txCheckInputsLoopKimageCheck; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_CH_IN_VAL_SIG = "tx_check_inputs_loop_ch_in_val_sig"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_CH_IN_VAL_SIG) + @javax.annotation.Nullable + private Integer txCheckInputsLoopChInValSig; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_GET_ITEM_SIZE = "tx_check_inputs_loop_scan_outputkeys_get_item_size"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_GET_ITEM_SIZE) + @javax.annotation.Nullable + private Integer txCheckInputsLoopScanOutputkeysGetItemSize; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_RELATIVE_TO_ABSOLUTE = "tx_check_inputs_loop_scan_outputkeys_relative_to_absolute"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_RELATIVE_TO_ABSOLUTE) + @javax.annotation.Nullable + private Integer txCheckInputsLoopScanOutputkeysRelativeToAbsolute; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP = "tx_check_inputs_loop_scan_outputkeys_loop"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP) + @javax.annotation.Nullable + private Integer txCheckInputsLoopScanOutputkeysLoop; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP_GET_SUBITEM = "tx_check_inputs_loop_scan_outputkeys_loop_get_subitem"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP_GET_SUBITEM) + @javax.annotation.Nullable + private Integer txCheckInputsLoopScanOutputkeysLoopGetSubitem; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP_FIND_TX = "tx_check_inputs_loop_scan_outputkeys_loop_find_tx"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP_FIND_TX) + @javax.annotation.Nullable + private Integer txCheckInputsLoopScanOutputkeysLoopFindTx; + + public static final String SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP_HANDLE_OUTPUT = "tx_check_inputs_loop_scan_outputkeys_loop_handle_output"; + @SerializedName(SERIALIZED_NAME_TX_CHECK_INPUTS_LOOP_SCAN_OUTPUTKEYS_LOOP_HANDLE_OUTPUT) + @javax.annotation.Nullable + private Integer txCheckInputsLoopScanOutputkeysLoopHandleOutput; + + public static final String SERIALIZED_NAME_TX_MIXIN_COUNT = "tx_mixin_count"; + @SerializedName(SERIALIZED_NAME_TX_MIXIN_COUNT) + @javax.annotation.Nullable + private Integer txMixinCount; + + public TxProcessingPerformanceModel() { + } + + public TxProcessingPerformanceModel txCheckInputs(@javax.annotation.Nullable Integer txCheckInputs) { + this.txCheckInputs = txCheckInputs; + return this; + } + + /** + * Get txCheckInputs + * @return txCheckInputs + */ + @javax.annotation.Nullable + public Integer getTxCheckInputs() { + return txCheckInputs; + } + + public void setTxCheckInputs(@javax.annotation.Nullable Integer txCheckInputs) { + this.txCheckInputs = txCheckInputs; + } + + + public TxProcessingPerformanceModel txAddOneTx(@javax.annotation.Nullable Integer txAddOneTx) { + this.txAddOneTx = txAddOneTx; + return this; + } + + /** + * Get txAddOneTx + * @return txAddOneTx + */ + @javax.annotation.Nullable + public Integer getTxAddOneTx() { + return txAddOneTx; + } + + public void setTxAddOneTx(@javax.annotation.Nullable Integer txAddOneTx) { + this.txAddOneTx = txAddOneTx; + } + + + public TxProcessingPerformanceModel txProcessExtra(@javax.annotation.Nullable Integer txProcessExtra) { + this.txProcessExtra = txProcessExtra; + return this; + } + + /** + * Get txProcessExtra + * @return txProcessExtra + */ + @javax.annotation.Nullable + public Integer getTxProcessExtra() { + return txProcessExtra; + } + + public void setTxProcessExtra(@javax.annotation.Nullable Integer txProcessExtra) { + this.txProcessExtra = txProcessExtra; + } + + + public TxProcessingPerformanceModel txProcessAttachment(@javax.annotation.Nullable Integer txProcessAttachment) { + this.txProcessAttachment = txProcessAttachment; + return this; + } + + /** + * Get txProcessAttachment + * @return txProcessAttachment + */ + @javax.annotation.Nullable + public Integer getTxProcessAttachment() { + return txProcessAttachment; + } + + public void setTxProcessAttachment(@javax.annotation.Nullable Integer txProcessAttachment) { + this.txProcessAttachment = txProcessAttachment; + } + + + public TxProcessingPerformanceModel txProcessInputs(@javax.annotation.Nullable Integer txProcessInputs) { + this.txProcessInputs = txProcessInputs; + return this; + } + + /** + * Get txProcessInputs + * @return txProcessInputs + */ + @javax.annotation.Nullable + public Integer getTxProcessInputs() { + return txProcessInputs; + } + + public void setTxProcessInputs(@javax.annotation.Nullable Integer txProcessInputs) { + this.txProcessInputs = txProcessInputs; + } + + + public TxProcessingPerformanceModel txPushGlobalIndex(@javax.annotation.Nullable Integer txPushGlobalIndex) { + this.txPushGlobalIndex = txPushGlobalIndex; + return this; + } + + /** + * Get txPushGlobalIndex + * @return txPushGlobalIndex + */ + @javax.annotation.Nullable + public Integer getTxPushGlobalIndex() { + return txPushGlobalIndex; + } + + public void setTxPushGlobalIndex(@javax.annotation.Nullable Integer txPushGlobalIndex) { + this.txPushGlobalIndex = txPushGlobalIndex; + } + + + public TxProcessingPerformanceModel txCheckExist(@javax.annotation.Nullable Integer txCheckExist) { + this.txCheckExist = txCheckExist; + return this; + } + + /** + * Get txCheckExist + * @return txCheckExist + */ + @javax.annotation.Nullable + public Integer getTxCheckExist() { + return txCheckExist; + } + + public void setTxCheckExist(@javax.annotation.Nullable Integer txCheckExist) { + this.txCheckExist = txCheckExist; + } + + + public TxProcessingPerformanceModel txPrintLog(@javax.annotation.Nullable Integer txPrintLog) { + this.txPrintLog = txPrintLog; + return this; + } + + /** + * Get txPrintLog + * @return txPrintLog + */ + @javax.annotation.Nullable + public Integer getTxPrintLog() { + return txPrintLog; + } + + public void setTxPrintLog(@javax.annotation.Nullable Integer txPrintLog) { + this.txPrintLog = txPrintLog; + } + + + public TxProcessingPerformanceModel txPrapareAppend(@javax.annotation.Nullable Integer txPrapareAppend) { + this.txPrapareAppend = txPrapareAppend; + return this; + } + + /** + * Get txPrapareAppend + * @return txPrapareAppend + */ + @javax.annotation.Nullable + public Integer getTxPrapareAppend() { + return txPrapareAppend; + } + + public void setTxPrapareAppend(@javax.annotation.Nullable Integer txPrapareAppend) { + this.txPrapareAppend = txPrapareAppend; + } + + + public TxProcessingPerformanceModel txAppend(@javax.annotation.Nullable Integer txAppend) { + this.txAppend = txAppend; + return this; + } + + /** + * Get txAppend + * @return txAppend + */ + @javax.annotation.Nullable + public Integer getTxAppend() { + return txAppend; + } + + public void setTxAppend(@javax.annotation.Nullable Integer txAppend) { + this.txAppend = txAppend; + } + + + public TxProcessingPerformanceModel txAppendRlWait(@javax.annotation.Nullable Integer txAppendRlWait) { + this.txAppendRlWait = txAppendRlWait; + return this; + } + + /** + * Get txAppendRlWait + * @return txAppendRlWait + */ + @javax.annotation.Nullable + public Integer getTxAppendRlWait() { + return txAppendRlWait; + } + + public void setTxAppendRlWait(@javax.annotation.Nullable Integer txAppendRlWait) { + this.txAppendRlWait = txAppendRlWait; + } + + + public TxProcessingPerformanceModel txAppendIsExpired(@javax.annotation.Nullable Integer txAppendIsExpired) { + this.txAppendIsExpired = txAppendIsExpired; + return this; + } + + /** + * Get txAppendIsExpired + * @return txAppendIsExpired + */ + @javax.annotation.Nullable + public Integer getTxAppendIsExpired() { + return txAppendIsExpired; + } + + public void setTxAppendIsExpired(@javax.annotation.Nullable Integer txAppendIsExpired) { + this.txAppendIsExpired = txAppendIsExpired; + } + + + public TxProcessingPerformanceModel txStoreDb(@javax.annotation.Nullable Integer txStoreDb) { + this.txStoreDb = txStoreDb; + return this; + } + + /** + * Get txStoreDb + * @return txStoreDb + */ + @javax.annotation.Nullable + public Integer getTxStoreDb() { + return txStoreDb; + } + + public void setTxStoreDb(@javax.annotation.Nullable Integer txStoreDb) { + this.txStoreDb = txStoreDb; + } + + + public TxProcessingPerformanceModel txCheckInputsPrefixHash(@javax.annotation.Nullable Integer txCheckInputsPrefixHash) { + this.txCheckInputsPrefixHash = txCheckInputsPrefixHash; + return this; + } + + /** + * Get txCheckInputsPrefixHash + * @return txCheckInputsPrefixHash + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsPrefixHash() { + return txCheckInputsPrefixHash; + } + + public void setTxCheckInputsPrefixHash(@javax.annotation.Nullable Integer txCheckInputsPrefixHash) { + this.txCheckInputsPrefixHash = txCheckInputsPrefixHash; + } + + + public TxProcessingPerformanceModel txCheckInputsAttachmentCheck(@javax.annotation.Nullable Integer txCheckInputsAttachmentCheck) { + this.txCheckInputsAttachmentCheck = txCheckInputsAttachmentCheck; + return this; + } + + /** + * Get txCheckInputsAttachmentCheck + * @return txCheckInputsAttachmentCheck + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsAttachmentCheck() { + return txCheckInputsAttachmentCheck; + } + + public void setTxCheckInputsAttachmentCheck(@javax.annotation.Nullable Integer txCheckInputsAttachmentCheck) { + this.txCheckInputsAttachmentCheck = txCheckInputsAttachmentCheck; + } + + + public TxProcessingPerformanceModel txCheckInputsLoop(@javax.annotation.Nullable Integer txCheckInputsLoop) { + this.txCheckInputsLoop = txCheckInputsLoop; + return this; + } + + /** + * Get txCheckInputsLoop + * @return txCheckInputsLoop + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoop() { + return txCheckInputsLoop; + } + + public void setTxCheckInputsLoop(@javax.annotation.Nullable Integer txCheckInputsLoop) { + this.txCheckInputsLoop = txCheckInputsLoop; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopKimageCheck(@javax.annotation.Nullable Integer txCheckInputsLoopKimageCheck) { + this.txCheckInputsLoopKimageCheck = txCheckInputsLoopKimageCheck; + return this; + } + + /** + * Get txCheckInputsLoopKimageCheck + * @return txCheckInputsLoopKimageCheck + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopKimageCheck() { + return txCheckInputsLoopKimageCheck; + } + + public void setTxCheckInputsLoopKimageCheck(@javax.annotation.Nullable Integer txCheckInputsLoopKimageCheck) { + this.txCheckInputsLoopKimageCheck = txCheckInputsLoopKimageCheck; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopChInValSig(@javax.annotation.Nullable Integer txCheckInputsLoopChInValSig) { + this.txCheckInputsLoopChInValSig = txCheckInputsLoopChInValSig; + return this; + } + + /** + * Get txCheckInputsLoopChInValSig + * @return txCheckInputsLoopChInValSig + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopChInValSig() { + return txCheckInputsLoopChInValSig; + } + + public void setTxCheckInputsLoopChInValSig(@javax.annotation.Nullable Integer txCheckInputsLoopChInValSig) { + this.txCheckInputsLoopChInValSig = txCheckInputsLoopChInValSig; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopScanOutputkeysGetItemSize(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysGetItemSize) { + this.txCheckInputsLoopScanOutputkeysGetItemSize = txCheckInputsLoopScanOutputkeysGetItemSize; + return this; + } + + /** + * Get txCheckInputsLoopScanOutputkeysGetItemSize + * @return txCheckInputsLoopScanOutputkeysGetItemSize + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopScanOutputkeysGetItemSize() { + return txCheckInputsLoopScanOutputkeysGetItemSize; + } + + public void setTxCheckInputsLoopScanOutputkeysGetItemSize(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysGetItemSize) { + this.txCheckInputsLoopScanOutputkeysGetItemSize = txCheckInputsLoopScanOutputkeysGetItemSize; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopScanOutputkeysRelativeToAbsolute(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysRelativeToAbsolute) { + this.txCheckInputsLoopScanOutputkeysRelativeToAbsolute = txCheckInputsLoopScanOutputkeysRelativeToAbsolute; + return this; + } + + /** + * Get txCheckInputsLoopScanOutputkeysRelativeToAbsolute + * @return txCheckInputsLoopScanOutputkeysRelativeToAbsolute + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopScanOutputkeysRelativeToAbsolute() { + return txCheckInputsLoopScanOutputkeysRelativeToAbsolute; + } + + public void setTxCheckInputsLoopScanOutputkeysRelativeToAbsolute(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysRelativeToAbsolute) { + this.txCheckInputsLoopScanOutputkeysRelativeToAbsolute = txCheckInputsLoopScanOutputkeysRelativeToAbsolute; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopScanOutputkeysLoop(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoop) { + this.txCheckInputsLoopScanOutputkeysLoop = txCheckInputsLoopScanOutputkeysLoop; + return this; + } + + /** + * Get txCheckInputsLoopScanOutputkeysLoop + * @return txCheckInputsLoopScanOutputkeysLoop + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopScanOutputkeysLoop() { + return txCheckInputsLoopScanOutputkeysLoop; + } + + public void setTxCheckInputsLoopScanOutputkeysLoop(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoop) { + this.txCheckInputsLoopScanOutputkeysLoop = txCheckInputsLoopScanOutputkeysLoop; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopScanOutputkeysLoopGetSubitem(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoopGetSubitem) { + this.txCheckInputsLoopScanOutputkeysLoopGetSubitem = txCheckInputsLoopScanOutputkeysLoopGetSubitem; + return this; + } + + /** + * Get txCheckInputsLoopScanOutputkeysLoopGetSubitem + * @return txCheckInputsLoopScanOutputkeysLoopGetSubitem + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopScanOutputkeysLoopGetSubitem() { + return txCheckInputsLoopScanOutputkeysLoopGetSubitem; + } + + public void setTxCheckInputsLoopScanOutputkeysLoopGetSubitem(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoopGetSubitem) { + this.txCheckInputsLoopScanOutputkeysLoopGetSubitem = txCheckInputsLoopScanOutputkeysLoopGetSubitem; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopScanOutputkeysLoopFindTx(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoopFindTx) { + this.txCheckInputsLoopScanOutputkeysLoopFindTx = txCheckInputsLoopScanOutputkeysLoopFindTx; + return this; + } + + /** + * Get txCheckInputsLoopScanOutputkeysLoopFindTx + * @return txCheckInputsLoopScanOutputkeysLoopFindTx + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopScanOutputkeysLoopFindTx() { + return txCheckInputsLoopScanOutputkeysLoopFindTx; + } + + public void setTxCheckInputsLoopScanOutputkeysLoopFindTx(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoopFindTx) { + this.txCheckInputsLoopScanOutputkeysLoopFindTx = txCheckInputsLoopScanOutputkeysLoopFindTx; + } + + + public TxProcessingPerformanceModel txCheckInputsLoopScanOutputkeysLoopHandleOutput(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoopHandleOutput) { + this.txCheckInputsLoopScanOutputkeysLoopHandleOutput = txCheckInputsLoopScanOutputkeysLoopHandleOutput; + return this; + } + + /** + * Get txCheckInputsLoopScanOutputkeysLoopHandleOutput + * @return txCheckInputsLoopScanOutputkeysLoopHandleOutput + */ + @javax.annotation.Nullable + public Integer getTxCheckInputsLoopScanOutputkeysLoopHandleOutput() { + return txCheckInputsLoopScanOutputkeysLoopHandleOutput; + } + + public void setTxCheckInputsLoopScanOutputkeysLoopHandleOutput(@javax.annotation.Nullable Integer txCheckInputsLoopScanOutputkeysLoopHandleOutput) { + this.txCheckInputsLoopScanOutputkeysLoopHandleOutput = txCheckInputsLoopScanOutputkeysLoopHandleOutput; + } + + + public TxProcessingPerformanceModel txMixinCount(@javax.annotation.Nullable Integer txMixinCount) { + this.txMixinCount = txMixinCount; + return this; + } + + /** + * Get txMixinCount + * @return txMixinCount + */ + @javax.annotation.Nullable + public Integer getTxMixinCount() { + return txMixinCount; + } + + public void setTxMixinCount(@javax.annotation.Nullable Integer txMixinCount) { + this.txMixinCount = txMixinCount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TxProcessingPerformanceModel txProcessingPerformanceModel = (TxProcessingPerformanceModel) o; + return Objects.equals(this.txCheckInputs, txProcessingPerformanceModel.txCheckInputs) && + Objects.equals(this.txAddOneTx, txProcessingPerformanceModel.txAddOneTx) && + Objects.equals(this.txProcessExtra, txProcessingPerformanceModel.txProcessExtra) && + Objects.equals(this.txProcessAttachment, txProcessingPerformanceModel.txProcessAttachment) && + Objects.equals(this.txProcessInputs, txProcessingPerformanceModel.txProcessInputs) && + Objects.equals(this.txPushGlobalIndex, txProcessingPerformanceModel.txPushGlobalIndex) && + Objects.equals(this.txCheckExist, txProcessingPerformanceModel.txCheckExist) && + Objects.equals(this.txPrintLog, txProcessingPerformanceModel.txPrintLog) && + Objects.equals(this.txPrapareAppend, txProcessingPerformanceModel.txPrapareAppend) && + Objects.equals(this.txAppend, txProcessingPerformanceModel.txAppend) && + Objects.equals(this.txAppendRlWait, txProcessingPerformanceModel.txAppendRlWait) && + Objects.equals(this.txAppendIsExpired, txProcessingPerformanceModel.txAppendIsExpired) && + Objects.equals(this.txStoreDb, txProcessingPerformanceModel.txStoreDb) && + Objects.equals(this.txCheckInputsPrefixHash, txProcessingPerformanceModel.txCheckInputsPrefixHash) && + Objects.equals(this.txCheckInputsAttachmentCheck, txProcessingPerformanceModel.txCheckInputsAttachmentCheck) && + Objects.equals(this.txCheckInputsLoop, txProcessingPerformanceModel.txCheckInputsLoop) && + Objects.equals(this.txCheckInputsLoopKimageCheck, txProcessingPerformanceModel.txCheckInputsLoopKimageCheck) && + Objects.equals(this.txCheckInputsLoopChInValSig, txProcessingPerformanceModel.txCheckInputsLoopChInValSig) && + Objects.equals(this.txCheckInputsLoopScanOutputkeysGetItemSize, txProcessingPerformanceModel.txCheckInputsLoopScanOutputkeysGetItemSize) && + Objects.equals(this.txCheckInputsLoopScanOutputkeysRelativeToAbsolute, txProcessingPerformanceModel.txCheckInputsLoopScanOutputkeysRelativeToAbsolute) && + Objects.equals(this.txCheckInputsLoopScanOutputkeysLoop, txProcessingPerformanceModel.txCheckInputsLoopScanOutputkeysLoop) && + Objects.equals(this.txCheckInputsLoopScanOutputkeysLoopGetSubitem, txProcessingPerformanceModel.txCheckInputsLoopScanOutputkeysLoopGetSubitem) && + Objects.equals(this.txCheckInputsLoopScanOutputkeysLoopFindTx, txProcessingPerformanceModel.txCheckInputsLoopScanOutputkeysLoopFindTx) && + Objects.equals(this.txCheckInputsLoopScanOutputkeysLoopHandleOutput, txProcessingPerformanceModel.txCheckInputsLoopScanOutputkeysLoopHandleOutput) && + Objects.equals(this.txMixinCount, txProcessingPerformanceModel.txMixinCount); + } + + @Override + public int hashCode() { + return Objects.hash(txCheckInputs, txAddOneTx, txProcessExtra, txProcessAttachment, txProcessInputs, txPushGlobalIndex, txCheckExist, txPrintLog, txPrapareAppend, txAppend, txAppendRlWait, txAppendIsExpired, txStoreDb, txCheckInputsPrefixHash, txCheckInputsAttachmentCheck, txCheckInputsLoop, txCheckInputsLoopKimageCheck, txCheckInputsLoopChInValSig, txCheckInputsLoopScanOutputkeysGetItemSize, txCheckInputsLoopScanOutputkeysRelativeToAbsolute, txCheckInputsLoopScanOutputkeysLoop, txCheckInputsLoopScanOutputkeysLoopGetSubitem, txCheckInputsLoopScanOutputkeysLoopFindTx, txCheckInputsLoopScanOutputkeysLoopHandleOutput, txMixinCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TxProcessingPerformanceModel {\n"); + sb.append(" txCheckInputs: ").append(toIndentedString(txCheckInputs)).append("\n"); + sb.append(" txAddOneTx: ").append(toIndentedString(txAddOneTx)).append("\n"); + sb.append(" txProcessExtra: ").append(toIndentedString(txProcessExtra)).append("\n"); + sb.append(" txProcessAttachment: ").append(toIndentedString(txProcessAttachment)).append("\n"); + sb.append(" txProcessInputs: ").append(toIndentedString(txProcessInputs)).append("\n"); + sb.append(" txPushGlobalIndex: ").append(toIndentedString(txPushGlobalIndex)).append("\n"); + sb.append(" txCheckExist: ").append(toIndentedString(txCheckExist)).append("\n"); + sb.append(" txPrintLog: ").append(toIndentedString(txPrintLog)).append("\n"); + sb.append(" txPrapareAppend: ").append(toIndentedString(txPrapareAppend)).append("\n"); + sb.append(" txAppend: ").append(toIndentedString(txAppend)).append("\n"); + sb.append(" txAppendRlWait: ").append(toIndentedString(txAppendRlWait)).append("\n"); + sb.append(" txAppendIsExpired: ").append(toIndentedString(txAppendIsExpired)).append("\n"); + sb.append(" txStoreDb: ").append(toIndentedString(txStoreDb)).append("\n"); + sb.append(" txCheckInputsPrefixHash: ").append(toIndentedString(txCheckInputsPrefixHash)).append("\n"); + sb.append(" txCheckInputsAttachmentCheck: ").append(toIndentedString(txCheckInputsAttachmentCheck)).append("\n"); + sb.append(" txCheckInputsLoop: ").append(toIndentedString(txCheckInputsLoop)).append("\n"); + sb.append(" txCheckInputsLoopKimageCheck: ").append(toIndentedString(txCheckInputsLoopKimageCheck)).append("\n"); + sb.append(" txCheckInputsLoopChInValSig: ").append(toIndentedString(txCheckInputsLoopChInValSig)).append("\n"); + sb.append(" txCheckInputsLoopScanOutputkeysGetItemSize: ").append(toIndentedString(txCheckInputsLoopScanOutputkeysGetItemSize)).append("\n"); + sb.append(" txCheckInputsLoopScanOutputkeysRelativeToAbsolute: ").append(toIndentedString(txCheckInputsLoopScanOutputkeysRelativeToAbsolute)).append("\n"); + sb.append(" txCheckInputsLoopScanOutputkeysLoop: ").append(toIndentedString(txCheckInputsLoopScanOutputkeysLoop)).append("\n"); + sb.append(" txCheckInputsLoopScanOutputkeysLoopGetSubitem: ").append(toIndentedString(txCheckInputsLoopScanOutputkeysLoopGetSubitem)).append("\n"); + sb.append(" txCheckInputsLoopScanOutputkeysLoopFindTx: ").append(toIndentedString(txCheckInputsLoopScanOutputkeysLoopFindTx)).append("\n"); + sb.append(" txCheckInputsLoopScanOutputkeysLoopHandleOutput: ").append(toIndentedString(txCheckInputsLoopScanOutputkeysLoopHandleOutput)).append("\n"); + sb.append(" txMixinCount: ").append(toIndentedString(txMixinCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("tx_check_inputs", "tx_add_one_tx", "tx_process_extra", "tx_process_attachment", "tx_process_inputs", "tx_push_global_index", "tx_check_exist", "tx_print_log", "tx_prapare_append", "tx_append", "tx_append_rl_wait", "tx_append_is_expired", "tx_store_db", "tx_check_inputs_prefix_hash", "tx_check_inputs_attachment_check", "tx_check_inputs_loop", "tx_check_inputs_loop_kimage_check", "tx_check_inputs_loop_ch_in_val_sig", "tx_check_inputs_loop_scan_outputkeys_get_item_size", "tx_check_inputs_loop_scan_outputkeys_relative_to_absolute", "tx_check_inputs_loop_scan_outputkeys_loop", "tx_check_inputs_loop_scan_outputkeys_loop_get_subitem", "tx_check_inputs_loop_scan_outputkeys_loop_find_tx", "tx_check_inputs_loop_scan_outputkeys_loop_handle_output", "tx_mixin_count")); + + // 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 TxProcessingPerformanceModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TxProcessingPerformanceModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TxProcessingPerformanceModel is not found in the empty JSON string", TxProcessingPerformanceModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TxProcessingPerformanceModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TxProcessingPerformanceModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TxProcessingPerformanceModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TxProcessingPerformanceModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TxProcessingPerformanceModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TxProcessingPerformanceModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TxProcessingPerformanceModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TxProcessingPerformanceModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TxProcessingPerformanceModel + * @throws IOException if the JSON string is invalid with respect to TxProcessingPerformanceModel + */ + public static TxProcessingPerformanceModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TxProcessingPerformanceModel.class); + } + + /** + * Convert an instance of TxProcessingPerformanceModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/main/java/org/openapitools/client/model/VersionModel.java b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/VersionModel.java new file mode 100644 index 00000000..f82fb6fc --- /dev/null +++ b/utils/sdk/client/java/src/main/java/org/openapitools/client/model/VersionModel.java @@ -0,0 +1,323 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import invalidPackageName.JSON; + +/** + * VersionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0") +public class VersionModel { + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public static final String SERIALIZED_NAME_VERSION_LONG = "version_long"; + @SerializedName(SERIALIZED_NAME_VERSION_LONG) + @javax.annotation.Nullable + private String versionLong; + + public static final String SERIALIZED_NAME_MAJOR = "major"; + @SerializedName(SERIALIZED_NAME_MAJOR) + @javax.annotation.Nullable + private String major; + + public static final String SERIALIZED_NAME_MINOR = "minor"; + @SerializedName(SERIALIZED_NAME_MINOR) + @javax.annotation.Nullable + private String minor; + + public static final String SERIALIZED_NAME_REVISION = "revision"; + @SerializedName(SERIALIZED_NAME_REVISION) + @javax.annotation.Nullable + private String revision; + + public VersionModel() { + } + + public VersionModel version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + + public VersionModel versionLong(@javax.annotation.Nullable String versionLong) { + this.versionLong = versionLong; + return this; + } + + /** + * Get versionLong + * @return versionLong + */ + @javax.annotation.Nullable + public String getVersionLong() { + return versionLong; + } + + public void setVersionLong(@javax.annotation.Nullable String versionLong) { + this.versionLong = versionLong; + } + + + public VersionModel major(@javax.annotation.Nullable String major) { + this.major = major; + return this; + } + + /** + * Get major + * @return major + */ + @javax.annotation.Nullable + public String getMajor() { + return major; + } + + public void setMajor(@javax.annotation.Nullable String major) { + this.major = major; + } + + + public VersionModel minor(@javax.annotation.Nullable String minor) { + this.minor = minor; + return this; + } + + /** + * Get minor + * @return minor + */ + @javax.annotation.Nullable + public String getMinor() { + return minor; + } + + public void setMinor(@javax.annotation.Nullable String minor) { + this.minor = minor; + } + + + public VersionModel revision(@javax.annotation.Nullable String revision) { + this.revision = revision; + return this; + } + + /** + * Get revision + * @return revision + */ + @javax.annotation.Nullable + public String getRevision() { + return revision; + } + + public void setRevision(@javax.annotation.Nullable String revision) { + this.revision = revision; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionModel versionModel = (VersionModel) o; + return Objects.equals(this.version, versionModel.version) && + Objects.equals(this.versionLong, versionModel.versionLong) && + Objects.equals(this.major, versionModel.major) && + Objects.equals(this.minor, versionModel.minor) && + Objects.equals(this.revision, versionModel.revision); + } + + @Override + public int hashCode() { + return Objects.hash(version, versionLong, major, minor, revision); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionModel {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" versionLong: ").append(toIndentedString(versionLong)).append("\n"); + sb.append(" major: ").append(toIndentedString(major)).append("\n"); + sb.append(" minor: ").append(toIndentedString(minor)).append("\n"); + sb.append(" revision: ").append(toIndentedString(revision)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("version", "version_long", "major", "minor", "revision")); + + // 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 VersionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VersionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in VersionModel is not found in the empty JSON string", VersionModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!VersionModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `VersionModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if ((jsonObj.get("version_long") != null && !jsonObj.get("version_long").isJsonNull()) && !jsonObj.get("version_long").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `version_long` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version_long").toString())); + } + if ((jsonObj.get("major") != null && !jsonObj.get("major").isJsonNull()) && !jsonObj.get("major").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `major` to be a primitive type in the JSON string but got `%s`", jsonObj.get("major").toString())); + } + if ((jsonObj.get("minor") != null && !jsonObj.get("minor").isJsonNull()) && !jsonObj.get("minor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `minor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("minor").toString())); + } + if ((jsonObj.get("revision") != null && !jsonObj.get("revision").isJsonNull()) && !jsonObj.get("revision").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `revision` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revision").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VersionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VersionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VersionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VersionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VersionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VersionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of VersionModel + * @throws IOException if the JSON string is invalid with respect to VersionModel + */ + public static VersionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VersionModel.class); + } + + /** + * Convert an instance of VersionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/utils/sdk/client/java/src/test/java/lthn/BlockApiTest.java b/utils/sdk/client/java/src/test/java/lthn/BlockApiTest.java new file mode 100644 index 00000000..ebcf1ea0 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/lthn/BlockApiTest.java @@ -0,0 +1,97 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package lthn; + +import invalidPackageName.ApiException; +import org.openapitools.client.model.BlockDetailsModel; +import org.openapitools.client.model.BlockTemplateModel; +import org.openapitools.client.model.BlockTemplateRequestModel; +import org.openapitools.client.model.HeightModel; +import org.openapitools.client.model.SubmitBlockRequestModel; +import org.openapitools.client.model.SubmitBlockResponseModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for BlockApi + */ +@Disabled +public class BlockApiTest { + + private final BlockApi api = new BlockApi(); + + /** + * Create a block template for mining + * + * @throws ApiException if the Api call fails + */ + @Test + public void createBlockTemplateTest() throws ApiException { + BlockTemplateRequestModel blockTemplateRequestModel = null; + BlockTemplateModel response = api.createBlockTemplate(blockTemplateRequestModel); + // TODO: test validations + } + + /** + * Get a block by its hash or height (ID) + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlockTest() throws ApiException { + String identifier = null; + BlockDetailsModel response = api.getBlock(identifier); + // TODO: test validations + } + + /** + * Get one or more blocks, with optional pagination. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlocksTest() throws ApiException { + List response = api.getBlocks(); + // TODO: test validations + } + + /** + * Get the current blockchain height + * + * @throws ApiException if the Api call fails + */ + @Test + public void getHeightTest() throws ApiException { + HeightModel response = api.getHeight(); + // TODO: test validations + } + + /** + * Submit a new block to the network + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitBlockTest() throws ApiException { + SubmitBlockRequestModel submitBlockRequestModel = null; + SubmitBlockResponseModel response = api.submitBlock(submitBlockRequestModel); + // TODO: test validations + } + +} diff --git a/utils/sdk/client/java/src/test/java/lthn/InfoApiTest.java b/utils/sdk/client/java/src/test/java/lthn/InfoApiTest.java new file mode 100644 index 00000000..bec7e1db --- /dev/null +++ b/utils/sdk/client/java/src/test/java/lthn/InfoApiTest.java @@ -0,0 +1,60 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package lthn; + +import invalidPackageName.ApiException; +import org.openapitools.client.model.InfoModel; +import org.openapitools.client.model.VersionModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for InfoApi + */ +@Disabled +public class InfoApiTest { + + private final InfoApi api = new InfoApi(); + + /** + * Get detailed information about the blockchain and daemon state + * + * @throws ApiException if the Api call fails + */ + @Test + public void getInfoTest() throws ApiException { + String flags = null; + InfoModel response = api.getInfo(flags); + // TODO: test validations + } + + /** + * Get API version + * + * Returns the current version of the API. + * + * @throws ApiException if the Api call fails + */ + @Test + public void versionTest() throws ApiException { + VersionModel response = api.version(); + // TODO: test validations + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/lthn/api/BlockApiTest.java b/utils/sdk/client/java/src/test/java/org/lthn/api/BlockApiTest.java new file mode 100644 index 00000000..5a30e582 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/lthn/api/BlockApiTest.java @@ -0,0 +1,97 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.api; + +import org.lthn.ApiException; +import org.openapitools.client.model.BlockDetailsModel; +import org.openapitools.client.model.BlockTemplateModel; +import org.openapitools.client.model.BlockTemplateRequestModel; +import org.openapitools.client.model.HeightModel; +import org.openapitools.client.model.SubmitBlockRequestModel; +import org.openapitools.client.model.SubmitBlockResponseModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for BlockApi + */ +@Disabled +public class BlockApiTest { + + private final BlockApi api = new BlockApi(); + + /** + * Create a block template for mining + * + * @throws ApiException if the Api call fails + */ + @Test + public void createBlockTemplateTest() throws ApiException { + BlockTemplateRequestModel blockTemplateRequestModel = null; + BlockTemplateModel response = api.createBlockTemplate(blockTemplateRequestModel); + // TODO: test validations + } + + /** + * Get a block by its hash or height (ID) + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlockTest() throws ApiException { + String identifier = null; + BlockDetailsModel response = api.getBlock(identifier); + // TODO: test validations + } + + /** + * Get one or more blocks, with optional pagination. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlocksTest() throws ApiException { + List response = api.getBlocks(); + // TODO: test validations + } + + /** + * Get the current blockchain height + * + * @throws ApiException if the Api call fails + */ + @Test + public void getHeightTest() throws ApiException { + HeightModel response = api.getHeight(); + // TODO: test validations + } + + /** + * Submit a new block to the network + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitBlockTest() throws ApiException { + SubmitBlockRequestModel submitBlockRequestModel = null; + SubmitBlockResponseModel response = api.submitBlock(submitBlockRequestModel); + // TODO: test validations + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/lthn/api/InfoApiTest.java b/utils/sdk/client/java/src/test/java/org/lthn/api/InfoApiTest.java new file mode 100644 index 00000000..380682e8 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/lthn/api/InfoApiTest.java @@ -0,0 +1,60 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.lthn.api; + +import org.lthn.ApiException; +import org.openapitools.client.model.InfoModel; +import org.openapitools.client.model.VersionModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for InfoApi + */ +@Disabled +public class InfoApiTest { + + private final InfoApi api = new InfoApi(); + + /** + * Get detailed information about the blockchain and daemon state + * + * @throws ApiException if the Api call fails + */ + @Test + public void getInfoTest() throws ApiException { + String flags = null; + InfoModel response = api.getInfo(flags); + // TODO: test validations + } + + /** + * Get API version + * + * Returns the current version of the API. + * + * @throws ApiException if the Api call fails + */ + @Test + public void versionTest() throws ApiException { + VersionModel response = api.version(); + // TODO: test validations + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/api/BlockApiTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/api/BlockApiTest.java new file mode 100644 index 00000000..09f56f08 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/api/BlockApiTest.java @@ -0,0 +1,97 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.BlockDetailsModel; +import org.openapitools.client.model.BlockTemplateModel; +import org.openapitools.client.model.BlockTemplateRequestModel; +import org.openapitools.client.model.HeightModel; +import org.openapitools.client.model.SubmitBlockRequestModel; +import org.openapitools.client.model.SubmitBlockResponseModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for BlockApi + */ +@Disabled +public class BlockApiTest { + + private final BlockApi api = new BlockApi(); + + /** + * Create a block template for mining + * + * @throws ApiException if the Api call fails + */ + @Test + public void createBlockTemplateTest() throws ApiException { + BlockTemplateRequestModel blockTemplateRequestModel = null; + BlockTemplateModel response = api.createBlockTemplate(blockTemplateRequestModel); + // TODO: test validations + } + + /** + * Get a block by its hash or height (ID) + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlockTest() throws ApiException { + String identifier = null; + BlockDetailsModel response = api.getBlock(identifier); + // TODO: test validations + } + + /** + * Get one or more blocks, with optional pagination. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlocksTest() throws ApiException { + List response = api.getBlocks(); + // TODO: test validations + } + + /** + * Get the current blockchain height + * + * @throws ApiException if the Api call fails + */ + @Test + public void getHeightTest() throws ApiException { + HeightModel response = api.getHeight(); + // TODO: test validations + } + + /** + * Submit a new block to the network + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitBlockTest() throws ApiException { + SubmitBlockRequestModel submitBlockRequestModel = null; + SubmitBlockResponseModel response = api.submitBlock(submitBlockRequestModel); + // TODO: test validations + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/api/InfoApiTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/api/InfoApiTest.java new file mode 100644 index 00000000..6a0640ab --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/api/InfoApiTest.java @@ -0,0 +1,60 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.InfoModel; +import org.openapitools.client.model.VersionModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for InfoApi + */ +@Disabled +public class InfoApiTest { + + private final InfoApi api = new InfoApi(); + + /** + * Get detailed information about the blockchain and daemon state + * + * @throws ApiException if the Api call fails + */ + @Test + public void getInfoTest() throws ApiException { + String flags = null; + InfoModel response = api.getInfo(flags); + // TODO: test validations + } + + /** + * Get API version + * + * Returns the current version of the API. + * + * @throws ApiException if the Api call fails + */ + @Test + public void versionTest() throws ApiException { + VersionModel response = api.version(); + // TODO: test validations + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockDetailsModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockDetailsModelTest.java new file mode 100644 index 00000000..db71b526 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockDetailsModelTest.java @@ -0,0 +1,243 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.TransactionDetailsModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BlockDetailsModel + */ +public class BlockDetailsModelTest { + private final BlockDetailsModel model = new BlockDetailsModel(); + + /** + * Model tests for BlockDetailsModel + */ + @Test + public void testBlockDetailsModel() { + // TODO: test BlockDetailsModel + } + + /** + * Test the property 'actualTimestamp' + */ + @Test + public void actualTimestampTest() { + // TODO: test actualTimestamp + } + + /** + * Test the property 'alreadyGeneratedCoins' + */ + @Test + public void alreadyGeneratedCoinsTest() { + // TODO: test alreadyGeneratedCoins + } + + /** + * Test the property 'baseReward' + */ + @Test + public void baseRewardTest() { + // TODO: test baseReward + } + + /** + * Test the property 'blob' + */ + @Test + public void blobTest() { + // TODO: test blob + } + + /** + * Test the property 'blockCumulativeSize' + */ + @Test + public void blockCumulativeSizeTest() { + // TODO: test blockCumulativeSize + } + + /** + * Test the property 'blockTselfSize' + */ + @Test + public void blockTselfSizeTest() { + // TODO: test blockTselfSize + } + + /** + * Test the property 'cumulativeDiffAdjusted' + */ + @Test + public void cumulativeDiffAdjustedTest() { + // TODO: test cumulativeDiffAdjusted + } + + /** + * Test the property 'cumulativeDiffPrecise' + */ + @Test + public void cumulativeDiffPreciseTest() { + // TODO: test cumulativeDiffPrecise + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'effectiveFeeMedian' + */ + @Test + public void effectiveFeeMedianTest() { + // TODO: test effectiveFeeMedian + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'isOrphan' + */ + @Test + public void isOrphanTest() { + // TODO: test isOrphan + } + + /** + * Test the property 'minerTextInfo' + */ + @Test + public void minerTextInfoTest() { + // TODO: test minerTextInfo + } + + /** + * Test the property 'objectInJson' + */ + @Test + public void objectInJsonTest() { + // TODO: test objectInJson + } + + /** + * Test the property 'penalty' + */ + @Test + public void penaltyTest() { + // TODO: test penalty + } + + /** + * Test the property 'powSeed' + */ + @Test + public void powSeedTest() { + // TODO: test powSeed + } + + /** + * Test the property 'prevId' + */ + @Test + public void prevIdTest() { + // TODO: test prevId + } + + /** + * Test the property 'summaryReward' + */ + @Test + public void summaryRewardTest() { + // TODO: test summaryReward + } + + /** + * Test the property 'thisBlockFeeMedian' + */ + @Test + public void thisBlockFeeMedianTest() { + // TODO: test thisBlockFeeMedian + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'totalFee' + */ + @Test + public void totalFeeTest() { + // TODO: test totalFee + } + + /** + * Test the property 'totalTxsSize' + */ + @Test + public void totalTxsSizeTest() { + // TODO: test totalTxsSize + } + + /** + * Test the property 'transactionsDetails' + */ + @Test + public void transactionsDetailsTest() { + // TODO: test transactionsDetails + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockProcessingPerformanceModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockProcessingPerformanceModelTest.java new file mode 100644 index 00000000..4ad38274 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockProcessingPerformanceModelTest.java @@ -0,0 +1,168 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BlockProcessingPerformanceModel + */ +public class BlockProcessingPerformanceModelTest { + private final BlockProcessingPerformanceModel model = new BlockProcessingPerformanceModel(); + + /** + * Model tests for BlockProcessingPerformanceModel + */ + @Test + public void testBlockProcessingPerformanceModel() { + // TODO: test BlockProcessingPerformanceModel + } + + /** + * Test the property 'blockProcessingTime0' + */ + @Test + public void blockProcessingTime0Test() { + // TODO: test blockProcessingTime0 + } + + /** + * Test the property 'blockProcessingTime1' + */ + @Test + public void blockProcessingTime1Test() { + // TODO: test blockProcessingTime1 + } + + /** + * Test the property 'targetCalculatingTime2' + */ + @Test + public void targetCalculatingTime2Test() { + // TODO: test targetCalculatingTime2 + } + + /** + * Test the property 'longhashCalculatingTime3' + */ + @Test + public void longhashCalculatingTime3Test() { + // TODO: test longhashCalculatingTime3 + } + + /** + * Test the property 'allTxsInsertTime5' + */ + @Test + public void allTxsInsertTime5Test() { + // TODO: test allTxsInsertTime5 + } + + /** + * Test the property 'etcStuff6' + */ + @Test + public void etcStuff6Test() { + // TODO: test etcStuff6 + } + + /** + * Test the property 'insertTime4' + */ + @Test + public void insertTime4Test() { + // TODO: test insertTime4 + } + + /** + * Test the property 'raiseBlockCoreEvent' + */ + @Test + public void raiseBlockCoreEventTest() { + // TODO: test raiseBlockCoreEvent + } + + /** + * Test the property 'validateMinerTransactionTime' + */ + @Test + public void validateMinerTransactionTimeTest() { + // TODO: test validateMinerTransactionTime + } + + /** + * Test the property 'collectRangeproofsDataFromTxTime' + */ + @Test + public void collectRangeproofsDataFromTxTimeTest() { + // TODO: test collectRangeproofsDataFromTxTime + } + + /** + * Test the property 'verifyMultipleZcOutsRangeProofsTime' + */ + @Test + public void verifyMultipleZcOutsRangeProofsTimeTest() { + // TODO: test verifyMultipleZcOutsRangeProofsTime + } + + /** + * Test the property 'targetCalculatingEnumBlocks' + */ + @Test + public void targetCalculatingEnumBlocksTest() { + // TODO: test targetCalculatingEnumBlocks + } + + /** + * Test the property 'targetCalculatingCalc' + */ + @Test + public void targetCalculatingCalcTest() { + // TODO: test targetCalculatingCalc + } + + /** + * Test the property 'posValidateKiSearch' + */ + @Test + public void posValidateKiSearchTest() { + // TODO: test posValidateKiSearch + } + + /** + * Test the property 'posValidateGetOutKeysForInputs' + */ + @Test + public void posValidateGetOutKeysForInputsTest() { + // TODO: test posValidateGetOutKeysForInputs + } + + /** + * Test the property 'posValidateZvp' + */ + @Test + public void posValidateZvpTest() { + // TODO: test posValidateZvp + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateModelTest.java new file mode 100644 index 00000000..4fbf4d9f --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateModelTest.java @@ -0,0 +1,113 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.client.model.TxGenerationContextModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BlockTemplateModel + */ +public class BlockTemplateModelTest { + private final BlockTemplateModel model = new BlockTemplateModel(); + + /** + * Model tests for BlockTemplateModel + */ + @Test + public void testBlockTemplateModel() { + // TODO: test BlockTemplateModel + } + + /** + * Test the property 'blocktemplateBlob' + */ + @Test + public void blocktemplateBlobTest() { + // TODO: test blocktemplateBlob + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + + /** + * Test the property 'minerTxTgc' + */ + @Test + public void minerTxTgcTest() { + // TODO: test minerTxTgc + } + + /** + * Test the property 'blockRewardWithoutFee' + */ + @Test + public void blockRewardWithoutFeeTest() { + // TODO: test blockRewardWithoutFee + } + + /** + * Test the property 'blockReward' + */ + @Test + public void blockRewardTest() { + // TODO: test blockReward + } + + /** + * Test the property 'txsFee' + */ + @Test + public void txsFeeTest() { + // TODO: test txsFee + } + + /** + * Test the property 'prevHash' + */ + @Test + public void prevHashTest() { + // TODO: test prevHash + } + + /** + * Test the property 'seed' + */ + @Test + public void seedTest() { + // TODO: test seed + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateRequestModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateRequestModelTest.java new file mode 100644 index 00000000..41b86325 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/BlockTemplateRequestModelTest.java @@ -0,0 +1,99 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.PosEntryModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BlockTemplateRequestModel + */ +public class BlockTemplateRequestModelTest { + private final BlockTemplateRequestModel model = new BlockTemplateRequestModel(); + + /** + * Model tests for BlockTemplateRequestModel + */ + @Test + public void testBlockTemplateRequestModel() { + // TODO: test BlockTemplateRequestModel + } + + /** + * Test the property 'minerAddress' + */ + @Test + public void minerAddressTest() { + // TODO: test minerAddress + } + + /** + * Test the property 'stakeholderAddress' + */ + @Test + public void stakeholderAddressTest() { + // TODO: test stakeholderAddress + } + + /** + * Test the property 'exNonce' + */ + @Test + public void exNonceTest() { + // TODO: test exNonce + } + + /** + * Test the property 'posBlock' + */ + @Test + public void posBlockTest() { + // TODO: test posBlock + } + + /** + * Test the property 'ignorePowTsCheck' + */ + @Test + public void ignorePowTsCheckTest() { + // TODO: test ignorePowTsCheck + } + + /** + * Test the property 'pe' + */ + @Test + public void peTest() { + // TODO: test pe + } + + /** + * Test the property 'explicitTxs' + */ + @Test + public void explicitTxsTest() { + // TODO: test explicitTxs + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/DbStatInfoModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/DbStatInfoModelTest.java new file mode 100644 index 00000000..194476df --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/DbStatInfoModelTest.java @@ -0,0 +1,64 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DbStatInfoModel + */ +public class DbStatInfoModelTest { + private final DbStatInfoModel model = new DbStatInfoModel(); + + /** + * Model tests for DbStatInfoModel + */ + @Test + public void testDbStatInfoModel() { + // TODO: test DbStatInfoModel + } + + /** + * Test the property 'txCount' + */ + @Test + public void txCountTest() { + // TODO: test txCount + } + + /** + * Test the property 'writeTxCount' + */ + @Test + public void writeTxCountTest() { + // TODO: test writeTxCount + } + + /** + * Test the property 'mapSize' + */ + @Test + public void mapSizeTest() { + // TODO: test mapSize + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/HeightModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/HeightModelTest.java new file mode 100644 index 00000000..022358a9 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/HeightModelTest.java @@ -0,0 +1,48 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HeightModel + */ +public class HeightModelTest { + private final HeightModel model = new HeightModel(); + + /** + * Model tests for HeightModel + */ + @Test + public void testHeightModel() { + // TODO: test HeightModel + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/InfoModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/InfoModelTest.java new file mode 100644 index 00000000..b079f408 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/InfoModelTest.java @@ -0,0 +1,414 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.MaintainersInfoModel; +import org.openapitools.client.model.PerformanceModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InfoModel + */ +public class InfoModelTest { + private final InfoModel model = new InfoModel(); + + /** + * Model tests for InfoModel + */ + @Test + public void testInfoModel() { + // TODO: test InfoModel + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + + /** + * Test the property 'txCount' + */ + @Test + public void txCountTest() { + // TODO: test txCount + } + + /** + * Test the property 'txPoolSize' + */ + @Test + public void txPoolSizeTest() { + // TODO: test txPoolSize + } + + /** + * Test the property 'altBlocksCount' + */ + @Test + public void altBlocksCountTest() { + // TODO: test altBlocksCount + } + + /** + * Test the property 'outgoingConnectionsCount' + */ + @Test + public void outgoingConnectionsCountTest() { + // TODO: test outgoingConnectionsCount + } + + /** + * Test the property 'incomingConnectionsCount' + */ + @Test + public void incomingConnectionsCountTest() { + // TODO: test incomingConnectionsCount + } + + /** + * Test the property 'synchronizedConnectionsCount' + */ + @Test + public void synchronizedConnectionsCountTest() { + // TODO: test synchronizedConnectionsCount + } + + /** + * Test the property 'whitePeerlistSize' + */ + @Test + public void whitePeerlistSizeTest() { + // TODO: test whitePeerlistSize + } + + /** + * Test the property 'greyPeerlistSize' + */ + @Test + public void greyPeerlistSizeTest() { + // TODO: test greyPeerlistSize + } + + /** + * Test the property 'currentBlocksMedian' + */ + @Test + public void currentBlocksMedianTest() { + // TODO: test currentBlocksMedian + } + + /** + * Test the property 'aliasCount' + */ + @Test + public void aliasCountTest() { + // TODO: test aliasCount + } + + /** + * Test the property 'currentMaxAllowedBlockSize' + */ + @Test + public void currentMaxAllowedBlockSizeTest() { + // TODO: test currentMaxAllowedBlockSize + } + + /** + * Test the property 'daemonNetworkState' + */ + @Test + public void daemonNetworkStateTest() { + // TODO: test daemonNetworkState + } + + /** + * Test the property 'synchronizationStartHeight' + */ + @Test + public void synchronizationStartHeightTest() { + // TODO: test synchronizationStartHeight + } + + /** + * Test the property 'maxNetSeenHeight' + */ + @Test + public void maxNetSeenHeightTest() { + // TODO: test maxNetSeenHeight + } + + /** + * Test the property 'mi' + */ + @Test + public void miTest() { + // TODO: test mi + } + + /** + * Test the property 'posAllowed' + */ + @Test + public void posAllowedTest() { + // TODO: test posAllowed + } + + /** + * Test the property 'posDifficulty' + */ + @Test + public void posDifficultyTest() { + // TODO: test posDifficulty + } + + /** + * Test the property 'powDifficulty' + */ + @Test + public void powDifficultyTest() { + // TODO: test powDifficulty + } + + /** + * Test the property 'defaultFee' + */ + @Test + public void defaultFeeTest() { + // TODO: test defaultFee + } + + /** + * Test the property 'minimumFee' + */ + @Test + public void minimumFeeTest() { + // TODO: test minimumFee + } + + /** + * Test the property 'isHardforkActive' + */ + @Test + public void isHardforkActiveTest() { + // TODO: test isHardforkActive + } + + /** + * Test the property 'netTimeDeltaMedian' + */ + @Test + public void netTimeDeltaMedianTest() { + // TODO: test netTimeDeltaMedian + } + + /** + * Test the property 'currentNetworkHashrate50' + */ + @Test + public void currentNetworkHashrate50Test() { + // TODO: test currentNetworkHashrate50 + } + + /** + * Test the property 'currentNetworkHashrate350' + */ + @Test + public void currentNetworkHashrate350Test() { + // TODO: test currentNetworkHashrate350 + } + + /** + * Test the property 'secondsFor10Blocks' + */ + @Test + public void secondsFor10BlocksTest() { + // TODO: test secondsFor10Blocks + } + + /** + * Test the property 'secondsFor30Blocks' + */ + @Test + public void secondsFor30BlocksTest() { + // TODO: test secondsFor30Blocks + } + + /** + * Test the property 'transactionsCntPerDay' + */ + @Test + public void transactionsCntPerDayTest() { + // TODO: test transactionsCntPerDay + } + + /** + * Test the property 'transactionsVolumePerDay' + */ + @Test + public void transactionsVolumePerDayTest() { + // TODO: test transactionsVolumePerDay + } + + /** + * Test the property 'lastPosTimestamp' + */ + @Test + public void lastPosTimestampTest() { + // TODO: test lastPosTimestamp + } + + /** + * Test the property 'lastPowTimestamp' + */ + @Test + public void lastPowTimestampTest() { + // TODO: test lastPowTimestamp + } + + /** + * Test the property 'totalCoins' + */ + @Test + public void totalCoinsTest() { + // TODO: test totalCoins + } + + /** + * Test the property 'lastBlockSize' + */ + @Test + public void lastBlockSizeTest() { + // TODO: test lastBlockSize + } + + /** + * Test the property 'txCountInLastBlock' + */ + @Test + public void txCountInLastBlockTest() { + // TODO: test txCountInLastBlock + } + + /** + * Test the property 'posSequenceFactor' + */ + @Test + public void posSequenceFactorTest() { + // TODO: test posSequenceFactor + } + + /** + * Test the property 'powSequenceFactor' + */ + @Test + public void powSequenceFactorTest() { + // TODO: test powSequenceFactor + } + + /** + * Test the property 'blockReward' + */ + @Test + public void blockRewardTest() { + // TODO: test blockReward + } + + /** + * Test the property 'lastBlockTotalReward' + */ + @Test + public void lastBlockTotalRewardTest() { + // TODO: test lastBlockTotalReward + } + + /** + * Test the property 'posDiffTotalCoinsRate' + */ + @Test + public void posDiffTotalCoinsRateTest() { + // TODO: test posDiffTotalCoinsRate + } + + /** + * Test the property 'lastBlockTimestamp' + */ + @Test + public void lastBlockTimestampTest() { + // TODO: test lastBlockTimestamp + } + + /** + * Test the property 'lastBlockHash' + */ + @Test + public void lastBlockHashTest() { + // TODO: test lastBlockHash + } + + /** + * Test the property 'posBlockTsShiftVsActual' + */ + @Test + public void posBlockTsShiftVsActualTest() { + // TODO: test posBlockTsShiftVsActual + } + + /** + * Test the property 'outsStat' + */ + @Test + public void outsStatTest() { + // TODO: test outsStat + } + + /** + * Test the property 'performanceData' + */ + @Test + public void performanceDataTest() { + // TODO: test performanceData + } + + /** + * Test the property 'offersCount' + */ + @Test + public void offersCountTest() { + // TODO: test offersCount + } + + /** + * Test the property 'expirationMedianTimestamp' + */ + @Test + public void expirationMedianTimestampTest() { + // TODO: test expirationMedianTimestamp + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/MaintainersInfoModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/MaintainersInfoModelTest.java new file mode 100644 index 00000000..1ac9dcb5 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/MaintainersInfoModelTest.java @@ -0,0 +1,80 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MaintainersInfoModel + */ +public class MaintainersInfoModelTest { + private final MaintainersInfoModel model = new MaintainersInfoModel(); + + /** + * Model tests for MaintainersInfoModel + */ + @Test + public void testMaintainersInfoModel() { + // TODO: test MaintainersInfoModel + } + + /** + * Test the property 'verMajor' + */ + @Test + public void verMajorTest() { + // TODO: test verMajor + } + + /** + * Test the property 'verMinor' + */ + @Test + public void verMinorTest() { + // TODO: test verMinor + } + + /** + * Test the property 'verRevision' + */ + @Test + public void verRevisionTest() { + // TODO: test verRevision + } + + /** + * Test the property 'buildNo' + */ + @Test + public void buildNoTest() { + // TODO: test buildNo + } + + /** + * Test the property 'mode' + */ + @Test + public void modeTest() { + // TODO: test mode + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/PerformanceModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/PerformanceModelTest.java new file mode 100644 index 00000000..4a1eb738 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/PerformanceModelTest.java @@ -0,0 +1,76 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.client.model.BlockProcessingPerformanceModel; +import org.openapitools.client.model.DbStatInfoModel; +import org.openapitools.client.model.TxPoolPerformanceModel; +import org.openapitools.client.model.TxProcessingPerformanceModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PerformanceModel + */ +public class PerformanceModelTest { + private final PerformanceModel model = new PerformanceModel(); + + /** + * Model tests for PerformanceModel + */ + @Test + public void testPerformanceModel() { + // TODO: test PerformanceModel + } + + /** + * Test the property 'blockProcessing' + */ + @Test + public void blockProcessingTest() { + // TODO: test blockProcessing + } + + /** + * Test the property 'txProcessing' + */ + @Test + public void txProcessingTest() { + // TODO: test txProcessing + } + + /** + * Test the property 'txPool' + */ + @Test + public void txPoolTest() { + // TODO: test txPool + } + + /** + * Test the property 'dbStatInfo' + */ + @Test + public void dbStatInfoTest() { + // TODO: test dbStatInfo + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/PosEntryModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/PosEntryModelTest.java new file mode 100644 index 00000000..abc79668 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/PosEntryModelTest.java @@ -0,0 +1,104 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PosEntryModel + */ +public class PosEntryModelTest { + private final PosEntryModel model = new PosEntryModel(); + + /** + * Model tests for PosEntryModel + */ + @Test + public void testPosEntryModel() { + // TODO: test PosEntryModel + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + + /** + * Test the property 'gIndex' + */ + @Test + public void gIndexTest() { + // TODO: test gIndex + } + + /** + * Test the property 'keyimage' + */ + @Test + public void keyimageTest() { + // TODO: test keyimage + } + + /** + * Test the property 'blockTimestamp' + */ + @Test + public void blockTimestampTest() { + // TODO: test blockTimestamp + } + + /** + * Test the property 'stakeUnlockTime' + */ + @Test + public void stakeUnlockTimeTest() { + // TODO: test stakeUnlockTime + } + + /** + * Test the property 'txId' + */ + @Test + public void txIdTest() { + // TODO: test txId + } + + /** + * Test the property 'txOutIndex' + */ + @Test + public void txOutIndexTest() { + // TODO: test txOutIndex + } + + /** + * Test the property 'walletIndex' + */ + @Test + public void walletIndexTest() { + // TODO: test walletIndex + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockRequestModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockRequestModelTest.java new file mode 100644 index 00000000..66fbbf26 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockRequestModelTest.java @@ -0,0 +1,48 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SubmitBlockRequestModel + */ +public class SubmitBlockRequestModelTest { + private final SubmitBlockRequestModel model = new SubmitBlockRequestModel(); + + /** + * Model tests for SubmitBlockRequestModel + */ + @Test + public void testSubmitBlockRequestModel() { + // TODO: test SubmitBlockRequestModel + } + + /** + * Test the property 'blockBlob' + */ + @Test + public void blockBlobTest() { + // TODO: test blockBlob + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockResponseModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockResponseModelTest.java new file mode 100644 index 00000000..6893ba70 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/SubmitBlockResponseModelTest.java @@ -0,0 +1,48 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SubmitBlockResponseModel + */ +public class SubmitBlockResponseModelTest { + private final SubmitBlockResponseModel model = new SubmitBlockResponseModel(); + + /** + * Model tests for SubmitBlockResponseModel + */ + @Test + public void testSubmitBlockResponseModel() { + // TODO: test SubmitBlockResponseModel + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionAttachmentModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionAttachmentModelTest.java new file mode 100644 index 00000000..cad51297 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionAttachmentModelTest.java @@ -0,0 +1,64 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TransactionAttachmentModel + */ +public class TransactionAttachmentModelTest { + private final TransactionAttachmentModel model = new TransactionAttachmentModel(); + + /** + * Model tests for TransactionAttachmentModel + */ + @Test + public void testTransactionAttachmentModel() { + // TODO: test TransactionAttachmentModel + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'shortView' + */ + @Test + public void shortViewTest() { + // TODO: test shortView + } + + /** + * Test the property 'detailsView' + */ + @Test + public void detailsViewTest() { + // TODO: test detailsView + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionDetailsModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionDetailsModelTest.java new file mode 100644 index 00000000..acb689ca --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionDetailsModelTest.java @@ -0,0 +1,150 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.TransactionAttachmentModel; +import org.openapitools.client.model.TransactionExtraModel; +import org.openapitools.client.model.TransactionInputModel; +import org.openapitools.client.model.TransactionOutputModel; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TransactionDetailsModel + */ +public class TransactionDetailsModelTest { + private final TransactionDetailsModel model = new TransactionDetailsModel(); + + /** + * Model tests for TransactionDetailsModel + */ + @Test + public void testTransactionDetailsModel() { + // TODO: test TransactionDetailsModel + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + + /** + * Test the property 'attachments' + */ + @Test + public void attachmentsTest() { + // TODO: test attachments + } + + /** + * Test the property 'blob' + */ + @Test + public void blobTest() { + // TODO: test blob + } + + /** + * Test the property 'blobSize' + */ + @Test + public void blobSizeTest() { + // TODO: test blobSize + } + + /** + * Test the property 'extra' + */ + @Test + public void extraTest() { + // TODO: test extra + } + + /** + * Test the property 'fee' + */ + @Test + public void feeTest() { + // TODO: test fee + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'ins' + */ + @Test + public void insTest() { + // TODO: test ins + } + + /** + * Test the property 'keeperBlock' + */ + @Test + public void keeperBlockTest() { + // TODO: test keeperBlock + } + + /** + * Test the property 'objectInJson' + */ + @Test + public void objectInJsonTest() { + // TODO: test objectInJson + } + + /** + * Test the property 'outs' + */ + @Test + public void outsTest() { + // TODO: test outs + } + + /** + * Test the property 'pubKey' + */ + @Test + public void pubKeyTest() { + // TODO: test pubKey + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionExtraModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionExtraModelTest.java new file mode 100644 index 00000000..ddd007c8 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionExtraModelTest.java @@ -0,0 +1,64 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TransactionExtraModel + */ +public class TransactionExtraModelTest { + private final TransactionExtraModel model = new TransactionExtraModel(); + + /** + * Model tests for TransactionExtraModel + */ + @Test + public void testTransactionExtraModel() { + // TODO: test TransactionExtraModel + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'shortView' + */ + @Test + public void shortViewTest() { + // TODO: test shortView + } + + /** + * Test the property 'detailsView' + */ + @Test + public void detailsViewTest() { + // TODO: test detailsView + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionInputModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionInputModelTest.java new file mode 100644 index 00000000..6dc94fe5 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionInputModelTest.java @@ -0,0 +1,82 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TransactionInputModel + */ +public class TransactionInputModelTest { + private final TransactionInputModel model = new TransactionInputModel(); + + /** + * Model tests for TransactionInputModel + */ + @Test + public void testTransactionInputModel() { + // TODO: test TransactionInputModel + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + + /** + * Test the property 'globalIndexes' + */ + @Test + public void globalIndexesTest() { + // TODO: test globalIndexes + } + + /** + * Test the property 'htlcOrigin' + */ + @Test + public void htlcOriginTest() { + // TODO: test htlcOrigin + } + + /** + * Test the property 'kimageOrMsId' + */ + @Test + public void kimageOrMsIdTest() { + // TODO: test kimageOrMsId + } + + /** + * Test the property 'multisigCount' + */ + @Test + public void multisigCountTest() { + // TODO: test multisigCount + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionOutputModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionOutputModelTest.java new file mode 100644 index 00000000..b9ff9e77 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TransactionOutputModelTest.java @@ -0,0 +1,82 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TransactionOutputModel + */ +public class TransactionOutputModelTest { + private final TransactionOutputModel model = new TransactionOutputModel(); + + /** + * Model tests for TransactionOutputModel + */ + @Test + public void testTransactionOutputModel() { + // TODO: test TransactionOutputModel + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + + /** + * Test the property 'globalIndex' + */ + @Test + public void globalIndexTest() { + // TODO: test globalIndex + } + + /** + * Test the property 'isSpent' + */ + @Test + public void isSpentTest() { + // TODO: test isSpent + } + + /** + * Test the property 'minimumSigs' + */ + @Test + public void minimumSigsTest() { + // TODO: test minimumSigs + } + + /** + * Test the property 'pubKeys' + */ + @Test + public void pubKeysTest() { + // TODO: test pubKeys + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxGenerationContextModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxGenerationContextModelTest.java new file mode 100644 index 00000000..cfb3eb6d --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxGenerationContextModelTest.java @@ -0,0 +1,234 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TxGenerationContextModel + */ +public class TxGenerationContextModelTest { + private final TxGenerationContextModel model = new TxGenerationContextModel(); + + /** + * Model tests for TxGenerationContextModel + */ + @Test + public void testTxGenerationContextModel() { + // TODO: test TxGenerationContextModel + } + + /** + * Test the property 'assetIds' + */ + @Test + public void assetIdsTest() { + // TODO: test assetIds + } + + /** + * Test the property 'blindedAssetIds' + */ + @Test + public void blindedAssetIdsTest() { + // TODO: test blindedAssetIds + } + + /** + * Test the property 'amountCommitments' + */ + @Test + public void amountCommitmentsTest() { + // TODO: test amountCommitments + } + + /** + * Test the property 'assetIdBlindingMasks' + */ + @Test + public void assetIdBlindingMasksTest() { + // TODO: test assetIdBlindingMasks + } + + /** + * Test the property 'amounts' + */ + @Test + public void amountsTest() { + // TODO: test amounts + } + + /** + * Test the property 'amountBlindingMasks' + */ + @Test + public void amountBlindingMasksTest() { + // TODO: test amountBlindingMasks + } + + /** + * Test the property 'pseudoOutsBlindedAssetIds' + */ + @Test + public void pseudoOutsBlindedAssetIdsTest() { + // TODO: test pseudoOutsBlindedAssetIds + } + + /** + * Test the property 'pseudoOutsPlusRealOutBlindingMasks' + */ + @Test + public void pseudoOutsPlusRealOutBlindingMasksTest() { + // TODO: test pseudoOutsPlusRealOutBlindingMasks + } + + /** + * Test the property 'realZcInsAssetIds' + */ + @Test + public void realZcInsAssetIdsTest() { + // TODO: test realZcInsAssetIds + } + + /** + * Test the property 'zcInputAmounts' + */ + @Test + public void zcInputAmountsTest() { + // TODO: test zcInputAmounts + } + + /** + * Test the property 'pseudoOutAmountCommitmentsSum' + */ + @Test + public void pseudoOutAmountCommitmentsSumTest() { + // TODO: test pseudoOutAmountCommitmentsSum + } + + /** + * Test the property 'pseudoOutAmountBlindingMasksSum' + */ + @Test + public void pseudoOutAmountBlindingMasksSumTest() { + // TODO: test pseudoOutAmountBlindingMasksSum + } + + /** + * Test the property 'realInAssetIdBlindingMaskXAmountSum' + */ + @Test + public void realInAssetIdBlindingMaskXAmountSumTest() { + // TODO: test realInAssetIdBlindingMaskXAmountSum + } + + /** + * Test the property 'amountCommitmentsSum' + */ + @Test + public void amountCommitmentsSumTest() { + // TODO: test amountCommitmentsSum + } + + /** + * Test the property 'amountBlindingMasksSum' + */ + @Test + public void amountBlindingMasksSumTest() { + // TODO: test amountBlindingMasksSum + } + + /** + * Test the property 'assetIdBlindingMaskXAmountSum' + */ + @Test + public void assetIdBlindingMaskXAmountSumTest() { + // TODO: test assetIdBlindingMaskXAmountSum + } + + /** + * Test the property 'aoAssetId' + */ + @Test + public void aoAssetIdTest() { + // TODO: test aoAssetId + } + + /** + * Test the property 'aoAssetIdPt' + */ + @Test + public void aoAssetIdPtTest() { + // TODO: test aoAssetIdPt + } + + /** + * Test the property 'aoAmountCommitment' + */ + @Test + public void aoAmountCommitmentTest() { + // TODO: test aoAmountCommitment + } + + /** + * Test the property 'aoAmountBlindingMask' + */ + @Test + public void aoAmountBlindingMaskTest() { + // TODO: test aoAmountBlindingMask + } + + /** + * Test the property 'aoCommitmentInOutputs' + */ + @Test + public void aoCommitmentInOutputsTest() { + // TODO: test aoCommitmentInOutputs + } + + /** + * Test the property 'txKeyPub' + */ + @Test + public void txKeyPubTest() { + // TODO: test txKeyPub + } + + /** + * Test the property 'txKeySec' + */ + @Test + public void txKeySecTest() { + // TODO: test txKeySec + } + + /** + * Test the property 'txPubKeyP' + */ + @Test + public void txPubKeyPTest() { + // TODO: test txPubKeyP + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxPoolPerformanceModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxPoolPerformanceModelTest.java new file mode 100644 index 00000000..69c66581 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxPoolPerformanceModelTest.java @@ -0,0 +1,128 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TxPoolPerformanceModel + */ +public class TxPoolPerformanceModelTest { + private final TxPoolPerformanceModel model = new TxPoolPerformanceModel(); + + /** + * Model tests for TxPoolPerformanceModel + */ + @Test + public void testTxPoolPerformanceModel() { + // TODO: test TxPoolPerformanceModel + } + + /** + * Test the property 'txProcessingTime' + */ + @Test + public void txProcessingTimeTest() { + // TODO: test txProcessingTime + } + + /** + * Test the property 'checkInputsTypesSupportedTime' + */ + @Test + public void checkInputsTypesSupportedTimeTest() { + // TODO: test checkInputsTypesSupportedTime + } + + /** + * Test the property 'expirationValidateTime' + */ + @Test + public void expirationValidateTimeTest() { + // TODO: test expirationValidateTime + } + + /** + * Test the property 'validateAmountTime' + */ + @Test + public void validateAmountTimeTest() { + // TODO: test validateAmountTime + } + + /** + * Test the property 'validateAliasTime' + */ + @Test + public void validateAliasTimeTest() { + // TODO: test validateAliasTime + } + + /** + * Test the property 'checkKeyimagesWsMsTime' + */ + @Test + public void checkKeyimagesWsMsTimeTest() { + // TODO: test checkKeyimagesWsMsTime + } + + /** + * Test the property 'checkInputsTime' + */ + @Test + public void checkInputsTimeTest() { + // TODO: test checkInputsTime + } + + /** + * Test the property 'beginTxTime' + */ + @Test + public void beginTxTimeTest() { + // TODO: test beginTxTime + } + + /** + * Test the property 'updateDbTime' + */ + @Test + public void updateDbTimeTest() { + // TODO: test updateDbTime + } + + /** + * Test the property 'dbCommitTime' + */ + @Test + public void dbCommitTimeTest() { + // TODO: test dbCommitTime + } + + /** + * Test the property 'checkPostHf4Balance' + */ + @Test + public void checkPostHf4BalanceTest() { + // TODO: test checkPostHf4Balance + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxProcessingPerformanceModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxProcessingPerformanceModelTest.java new file mode 100644 index 00000000..854a6229 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/TxProcessingPerformanceModelTest.java @@ -0,0 +1,240 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TxProcessingPerformanceModel + */ +public class TxProcessingPerformanceModelTest { + private final TxProcessingPerformanceModel model = new TxProcessingPerformanceModel(); + + /** + * Model tests for TxProcessingPerformanceModel + */ + @Test + public void testTxProcessingPerformanceModel() { + // TODO: test TxProcessingPerformanceModel + } + + /** + * Test the property 'txCheckInputs' + */ + @Test + public void txCheckInputsTest() { + // TODO: test txCheckInputs + } + + /** + * Test the property 'txAddOneTx' + */ + @Test + public void txAddOneTxTest() { + // TODO: test txAddOneTx + } + + /** + * Test the property 'txProcessExtra' + */ + @Test + public void txProcessExtraTest() { + // TODO: test txProcessExtra + } + + /** + * Test the property 'txProcessAttachment' + */ + @Test + public void txProcessAttachmentTest() { + // TODO: test txProcessAttachment + } + + /** + * Test the property 'txProcessInputs' + */ + @Test + public void txProcessInputsTest() { + // TODO: test txProcessInputs + } + + /** + * Test the property 'txPushGlobalIndex' + */ + @Test + public void txPushGlobalIndexTest() { + // TODO: test txPushGlobalIndex + } + + /** + * Test the property 'txCheckExist' + */ + @Test + public void txCheckExistTest() { + // TODO: test txCheckExist + } + + /** + * Test the property 'txPrintLog' + */ + @Test + public void txPrintLogTest() { + // TODO: test txPrintLog + } + + /** + * Test the property 'txPrapareAppend' + */ + @Test + public void txPrapareAppendTest() { + // TODO: test txPrapareAppend + } + + /** + * Test the property 'txAppend' + */ + @Test + public void txAppendTest() { + // TODO: test txAppend + } + + /** + * Test the property 'txAppendRlWait' + */ + @Test + public void txAppendRlWaitTest() { + // TODO: test txAppendRlWait + } + + /** + * Test the property 'txAppendIsExpired' + */ + @Test + public void txAppendIsExpiredTest() { + // TODO: test txAppendIsExpired + } + + /** + * Test the property 'txStoreDb' + */ + @Test + public void txStoreDbTest() { + // TODO: test txStoreDb + } + + /** + * Test the property 'txCheckInputsPrefixHash' + */ + @Test + public void txCheckInputsPrefixHashTest() { + // TODO: test txCheckInputsPrefixHash + } + + /** + * Test the property 'txCheckInputsAttachmentCheck' + */ + @Test + public void txCheckInputsAttachmentCheckTest() { + // TODO: test txCheckInputsAttachmentCheck + } + + /** + * Test the property 'txCheckInputsLoop' + */ + @Test + public void txCheckInputsLoopTest() { + // TODO: test txCheckInputsLoop + } + + /** + * Test the property 'txCheckInputsLoopKimageCheck' + */ + @Test + public void txCheckInputsLoopKimageCheckTest() { + // TODO: test txCheckInputsLoopKimageCheck + } + + /** + * Test the property 'txCheckInputsLoopChInValSig' + */ + @Test + public void txCheckInputsLoopChInValSigTest() { + // TODO: test txCheckInputsLoopChInValSig + } + + /** + * Test the property 'txCheckInputsLoopScanOutputkeysGetItemSize' + */ + @Test + public void txCheckInputsLoopScanOutputkeysGetItemSizeTest() { + // TODO: test txCheckInputsLoopScanOutputkeysGetItemSize + } + + /** + * Test the property 'txCheckInputsLoopScanOutputkeysRelativeToAbsolute' + */ + @Test + public void txCheckInputsLoopScanOutputkeysRelativeToAbsoluteTest() { + // TODO: test txCheckInputsLoopScanOutputkeysRelativeToAbsolute + } + + /** + * Test the property 'txCheckInputsLoopScanOutputkeysLoop' + */ + @Test + public void txCheckInputsLoopScanOutputkeysLoopTest() { + // TODO: test txCheckInputsLoopScanOutputkeysLoop + } + + /** + * Test the property 'txCheckInputsLoopScanOutputkeysLoopGetSubitem' + */ + @Test + public void txCheckInputsLoopScanOutputkeysLoopGetSubitemTest() { + // TODO: test txCheckInputsLoopScanOutputkeysLoopGetSubitem + } + + /** + * Test the property 'txCheckInputsLoopScanOutputkeysLoopFindTx' + */ + @Test + public void txCheckInputsLoopScanOutputkeysLoopFindTxTest() { + // TODO: test txCheckInputsLoopScanOutputkeysLoopFindTx + } + + /** + * Test the property 'txCheckInputsLoopScanOutputkeysLoopHandleOutput' + */ + @Test + public void txCheckInputsLoopScanOutputkeysLoopHandleOutputTest() { + // TODO: test txCheckInputsLoopScanOutputkeysLoopHandleOutput + } + + /** + * Test the property 'txMixinCount' + */ + @Test + public void txMixinCountTest() { + // TODO: test txMixinCount + } + +} diff --git a/utils/sdk/client/java/src/test/java/org/openapitools/client/model/VersionModelTest.java b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/VersionModelTest.java new file mode 100644 index 00000000..cb878978 --- /dev/null +++ b/utils/sdk/client/java/src/test/java/org/openapitools/client/model/VersionModelTest.java @@ -0,0 +1,80 @@ +/* + * Lethean Blockchain API + * OpenAPI for Lethean Blockchain + * + * The version of the OpenAPI document: 6.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for VersionModel + */ +public class VersionModelTest { + private final VersionModel model = new VersionModel(); + + /** + * Model tests for VersionModel + */ + @Test + public void testVersionModel() { + // TODO: test VersionModel + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'versionLong' + */ + @Test + public void versionLongTest() { + // TODO: test versionLong + } + + /** + * Test the property 'major' + */ + @Test + public void majorTest() { + // TODO: test major + } + + /** + * Test the property 'minor' + */ + @Test + public void minorTest() { + // TODO: test minor + } + + /** + * Test the property 'revision' + */ + @Test + public void revisionTest() { + // TODO: test revision + } + +} diff --git a/utils/sdk/packages/java.json b/utils/sdk/packages/java.json index 7ddda99c..7a73a41b 100644 --- a/utils/sdk/packages/java.json +++ b/utils/sdk/packages/java.json @@ -1,5 +1,2 @@ { - "additionalProperties": { - "packageName":"@snider/sdk-cpp-oatpp" - } } \ No newline at end of file diff --git a/utils/sdk/packages/php.json b/utils/sdk/packages/php.json index 660cff71..82d047af 100644 --- a/utils/sdk/packages/php.json +++ b/utils/sdk/packages/php.json @@ -1,10 +1,5 @@ { "additionalProperties": { - "apiPackage": "lthn", - "packageName": "lthn", - "modelPackage": "lthn", - "invokerPackage": "lthn", - "licenceName": "EUPL-1.2", "composerPackageName": "letheanvpn/blockchain" } } \ No newline at end of file